equery d boost | grep `equery d --name-only python`
Actually for -0.3.1 we are moving to a customizable output format.
this is from equery virtual:
(" -F, --format=TMPL", "specify a custom output format"),
"a format template using (see man page):")
From that you will be able to specify exactly how & what you want displayed.
Several of the equery modules have this ability now. The others will be migrated to this ability for the next version.
I have just done some preliminary work to add custom format capability to equery depends. I have it producing an equivalent --name-only output using
equery -qC depends -F '$cp' python
so it outputs only the category/package name and no other data,
but using the command you listed as an example produces no output.
Please state what the desired result of your example command is suppose to be.
I took it as finding the pkgs that common to both.
If that is the case, then it would be much better to create either a new module or a new option that uses the data gathered by the results of all depends queries and outputs the set.intersection(query1, query2,...)
It would be quite easy now that there is an api to the depends capability that returns a python list.
equery depends --intersection -F '$cp' boost python
brian@big_daddy ~ $ python
Python 2.6.6 (r266:84292, Mar 5 2011, 10:27:05)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gentoolkit.dependencies import Dependencies
>>> from gentoolkit.helpers import get_installed_cpvs
>>> boost = Dependencies('boost')
>>> python = Dependencies('python')
>>> rdep_boost = boost.graph_reverse_depends(pkgset=sorted(get_installed_cpvs()))
>>> rdep_python = python.graph_reverse_depends(pkgset=sorted(get_installed_cpvs()))
>>> common=set.intersection(set(rdep_boost), set(rdep_python))
>>> for p in common:
... print p.cp
Well, I'd like to have a list which shows all packages that depend on boost and python. Something like
equery d ( boost && python < && somthing>* )
equery d <package-name>*
would be nice.
Just seen that --name-only just omits the version numbers. I just need the package name. What I (wrongly) tried to express was something like:
equery d python | grep `equery d boost --just-the-package-name`
which would output somethin like
where `equery d boost --just-the-package-name` would output something like
IMO having the option to give several packages and use operators (braces, and, or, not) would be the most satisfactory and flexible solution. ;)
Erm ... probably most work as well. :(