How to check what USE flags are supported for a virtual package pointing to my package, before installing it?
How to list supported USE flags for virtual package before installation?
599 Views Asked by A. Gille AtThere are 3 best solutions below
On
Virtual packages are somewhat unique in that most of them do not have USE flags. A handful do, and for those equery uses <package> will show their USE flags (i.e. equery uses virtual/pypy).
For the typical virtual package with no USE flags, the USE flags depend on which package is used to satisfy the virtual, for example virtual/commonlisp:
% equery use virtual/commonlisp
!!! No USE flags found for virtual/commonlisp-0
In this case, you would need to look at what packages could satisfy the virtual, to do this you can use equery depgraph:
% equery depgraph commonlisp
* Searching for commonlisp ...
* dependency graph for virtual/commonlisp-0
`-- virtual/commonlisp-0 amd64
`-- dev-lisp/sbcl-1.3.12 (dev-lisp/sbcl) ~amd64
`-- dev-lisp/clisp-2.49-r100 (dev-lisp/clisp) ~amd64
`-- dev-lisp/clozurecl-1.11-r1 (dev-lisp/clozurecl) ~amd64
`-- dev-lisp/cmucl-21a (dev-lisp/cmucl) [missing keyword]
`-- dev-lisp/ecls-16.1.3 (dev-lisp/ecls) ~amd64
[ virtual/commonlisp-0 stats: packages (6), max depth (1) ]
If you try to emerge a virtual, it will select the first in the list, for example:
% emerge -pv 'virtual/cdrtools' && equery depgraph 'virtual/cdrtools'
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild N ] app-cdr/cdrtools-3.02_alpha06-r1::gentoo USE="acl caps filecaps nls unicode" 2,069 KiB
[ebuild N ] virtual/cdrtools-0::gentoo 0 KiB
Total: 2 packages (2 new), Size of downloads: 2,069 KiB
* Searching for cdrtools in virtual ...
* dependency graph for virtual/cdrtools-0
`-- virtual/cdrtools-0 amd64
`-- app-cdr/cdrtools-3.02_alpha06-r1 (app-cdr/cdrtools) ~amd64
`-- app-cdr/cdrkit-1.1.11-r2 (app-cdr/cdrkit) amd64
[ virtual/cdrtools-0 stats: packages (3), max depth (1) ]
In my current portage tree, I only see 59 of 452 virtuals with USE flags. To arrive at this conclusion I counted how many ebuilds in /usr/portage/virtual did not have IUSE="" with grep -r 'IUSE' /usr/portage/virtual | grep 'ebuild' | egrep -v 'IUSE=""' | wc -l, then I counted how many ebuilds specified IUSE at all: grep -r 'IUSE' /usr/portage/virtual | grep 'ebuild' | wc -l.
Try
equery uses <package-name>