The -q option (which lists packages that depend on the specified package) does not take the USE flags into account. When an ebuild's dependencies change depending on a USE flag, it seems to act as if the USE flag in question is enabled. For example, in many cases "esound" is often a dependency of some packages if the "esd" flag is set (in other words the ebuild has a line like esd? (>= media-sound/esound-0.2.22), the xmms and xmame ebuilds are examples of this. qpkg will always say that xmms and xmame depend on esound, regardless of whether the "esd" USE flag is set or not. Reproducible: Always Steps to Reproduce: USE="-esd" qpkg -q esound-0.2.29 Actual Results: media-sound/esound-0.2.29 * DEPENDED ON BY: app-emulation/xmame-0.72.1 media-sound/xmms-1.2.7-r20 (there are more ebuilds it reports such as xine-lib) Expected Results: qpkg should not report that xmame and xmms depend on esound if the "esd" USE flag is not set. Only if the "esd" USE flag is set should this happen.
If qpkg were to take into account the USE flags, setting USE in the environment wouldn't affect the output. It should look at /var/db/pkg/pkg-cat/pkgname/USE.
It still does not take /var/db/pkg/pkg-cat/pkgname/USE into consideration. qpkg -q -I arts (this should make it only show me the installed progs I've got) kde-base/arts-1.2.1 * DEPENDED ON BY: media-libs/libao-0.8.5 media-libs/libsdl-1.2.7 media-video/mplayer-1.0_pre3-r5 I verified that I had -arts in USE="" in /etc/make.conf. And then verified that arts did not show up in emerge info. emerge info Portage 2.0.50-r2 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.4-gentoo-r1) ================================================================= System uname: 2.6.4-gentoo-r1 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.40GHz Gentoo Base System version 1.4.3.13p1 distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer -fexpensive-optimizations -ffast-math -falign-functions=4 -fforce-addr -funroll-loops -maccumulate-outgoing-args -frerun-loop-opt -fprefetch-loop-arrays -frerun-cse-after-loop -mfpmath=sse" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer -fexpensive-optimizations -ffast-math -falign-functions=4 -fforce-addr -funroll-loops -maccumulate-outgoing-args -frerun-loop-opt -fprefetch-loop-arrays -frerun-cse-after-loop -mfpmath=sse" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync2.us.gentoo.org/gentoo-portage" USE="X alsa apm avi berkdb cdr crypt cups dvd encode esd foomaticdb footmaticdb gdbm gif gnome gnomedb gphoto2 gpm gstreamer gtk gtk2 imlib ipv6 java jpeg libg++ libwww mad mikmod motif mozilla moznocompose moznoirc moznomail mozsvg mpeg mysql ncurses nogcj nptl oav oggvorbis opengl oss pam pcmcia pdflib perl pic png pnp ppds python qt quicktime readline samba sdl slang slp smooth spell sse ssl svga tcltk tcpd tiff truetype usb wmf x86 xml2 xmms xv zlib" re-emerged all 3 packages. And ran qpkg -q -I arts again. And the same depends showed up. So I did the following.... cat /var/db/pkg/media-libs/libao-0.8.5/USE X alsa apm avi berkdb cdr crypt cups dvd encode esd foomaticdb footmaticdb gdbm gif gnome gnomedb gphoto2 gpm gstreamer gtk gtk2 imlib ipv6 java jpeg libg++ libwww mad mikmod motif mozilla moznocompose moznoirc moznomail mozsvg mpeg mysql ncurses nogcj nptl oav oggvorbis opengl oss pam pcmcia pdflib perl pic png pnp ppds python qt quicktime readline samba sdl slang slp smooth spell sse ssl svga tcltk tcpd tiff truetype usb wmf x86 xml2 xmms xv zlib There's no arts in there. As far as I'm concerned the package did not build using arts. Now either there's a bug with this tool, or there is something wrong with use_enable. Upon unmerging arts. qpkg -q -I arts displayed nothing.
*** Bug 51067 has been marked as a duplicate of this bug. ***
I can confirm this bug. I originally had some qt applications and doxygen emerged (because of USE="qt" being in the system's make.defaults), correctly pulling in qt. When I explicitly added USE="-qt" in /etc/make.conf and re-emerged doxygen, qpkg qt -I -q -vv outputted incorrectly that doxygen depended on qt. Once I removed the other qt applications, qpkg qt -I -q -vv still replied that doxygen required qt. Upon emerge depclean, qt was correctly unmerged. At this time, running qpkg qt -q -vv again (and searching for the correct version) still replied that doxygen required qt. equery depgraph doxygen also suffered from this bug until emerge depclean, at which point it removed qt from the depgraph.
The -q option is broken by design, also qpkg is deprecated.