Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 367203 - app-portage/gentoolkit equery d --name-only (as with option b) would be useful
Summary: app-portage/gentoolkit equery d --name-only (as with option b) would be useful
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal enhancement with 2 votes (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-14 08:38 UTC by Attila Stehr
Modified: 2011-05-20 16:39 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Attila Stehr 2011-05-14 08:38:24 UTC
equery d boost | grep `equery d --name-only python`

Reproducible: Always
Comment 1 Brian Dolbec gentoo-dev 2011-05-14 17:14:15 UTC
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"),
		("              TMPL",
			"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.
Comment 2 Brian Dolbec gentoo-dev 2011-05-14 20:14:58 UTC
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.

such as:

equery depends --intersection -F '$cp' boost python


eg:


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
... 
app-office/openoffice
media-gfx/exiv2
net-libs/rb_libtorrent
>>>
Comment 3 Attila Stehr 2011-05-20 16:39:30 UTC
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>* )
or 
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

app-office/openoffice

where `equery d boost --just-the-package-name` would output something like

app-office/openoffice
www-plugins/gnash
www-plugins/lightspark


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. :(