Lately I have been installing Gentoo on various machines, and I keep running into problems that arise because portage does not always emerge packages in an order that respects their dependencies. For example, consider: % emerge -e x11-libs/qt -ptv These are the packages that I would merge, in reverse order: Calculating dependencies . ...done! [ebuild N ] dev-db/qt-unixODBC-3.3.4-r1 0 kB [ebuild N ] net-fs/samba-3.0.20a -acl -async -automount +cups -doc -kerberos +ldap -libclamav +mysql -oav +pam -postgres +python -quotas +readline (-selinux) -syslog -winbind -xml +xml2 16,801 kB [ebuild N ] dev-libs/popt-1.7-r1 +nls 561 kB [ebuild N ] net-nds/openldap-2.2.28-r1 +berkdb +crypt -debug +gdbm +ipv6 -kerberos -minimal +odbc +perl +readline +samba +sasl +slp +ssl +tcpd 4,565 kB [ebuild N ] dev-db/unixODBC-2.2.11-r1 -gnome +qt 2,350 kB [ebuild N ] dev-perl/DBD-mysql-2.9007 114 kB [ebuild N ] dev-perl/DBI-1.48 369 kB [ebuild N ] dev-perl/PlRPC-0.2018 17 kB [ebuild N ] dev-perl/Net-Daemon-0.38 30 kB [ebuild N ] perl-core/Storable-2.13 131 kB [ebuild N ] dev-libs/cyrus-sasl-2.1.21-r1 -authdaemond +berkdb +crypt +gdbm -java -kerberos +ldap +mysql -ntlm_unsupported_patch +pam -postgres -sample -srp +ssl -static -urandom 1,547 kB [ebuild N ] dev-db/mysql-4.1.14 +berkdb -big-tables -cluster -debug -doc -extraengine -geometry -minimal +perl +readline (-selinux) +ssl -static +tcpd -utf8 0 kB [ebuild N ] sys-process/procps-3.2.5-r1 (-n32) 270 kB [ebuild N ] sys-apps/tcp-wrappers-7.6-r8 +ipv6 115 kB [ebuild N ] x11-libs/qt-3.3.4-r8 +cups -debug -doc -examples -firebird +gif -immqt -immqt-bc +ipv6 +mysql -nas +odbc +opengl -postgres +sqlite -xinerama 0 kB [ebuild N ] net-print/cups-1.1.23-r4 -cjk -gnutls +nls +pam +samba +slp +ssl 0 kB [ebuild N ] net-libs/openslp-1.2.1 0 kB [ebuild N ] app-text/xpdf-3.01 +X +motif 0 kB [ebuild N ] media-libs/t1lib-5.0.2 +X -doc 0 kB [ebuild N ] app-text/ghostscript-7.07.1-r10 +X -cjk +cups +emacs +gtk 0 kB [ebuild N ] media-fonts/gnu-gs-fonts-std-8.11 0 kB [ebuild N ] x11-libs/gtk+-2.6.10 -doc +jpeg -static +tiff 0 kB [ebuild N ] x11-misc/shared-mime-info-0.16 0 kB [ebuild N ] dev-libs/libxml2-2.6.22 -debug -doc +ipv6 +python +readline -static 0 kB [ebuild N ] dev-util/intltool-0.34.1 0 kB [ebuild N ] dev-perl/XML-Parser-2.34 0 kB [ebuild N ] dev-libs/atk-1.10.3 -debug -doc -static 0 kB [ebuild N ] x11-libs/pango-1.8.2 -debug -doc -static 0 kB [ebuild N ] dev-libs/glib-2.6.5 -doc -hardened -static 0 kB [ebuild N ] x11-libs/openmotif-2.2.3-r7 0 kB [ebuild N ] x11-libs/motif-config-0.9 0 kB [ebuild N ] media-libs/libmng-1.0.8-r1 0 kB [ebuild N ] media-libs/lcms-1.14-r1 +jpeg +python +tiff +zlib 0 kB [ebuild N ] media-libs/tiff-3.7.4 +jpeg -nocxx +zlib 0 kB [ebuild N ] x11-terms/xterm-204 -Xaw3d -toolbar +truetype +unicode 0 kB [ebuild N ] sys-apps/utempter-0.5.5.6 0 kB [ebuild N ] app-arch/rpm2targz-9.0-r4 0 kB [ebuild N ] app-arch/cpio-2.6-r4 +nls 437 kB [ebuild N ] sys-apps/which-2.16 122 kB [ebuild N ] sys-apps/file-4.15-r1 -build +python 0 kB [ebuild N ] x11-base/xorg-x11-6.8.2-r6 -3dfx -3dnow +bitmap-fonts -cjk -debug -dlloader -dmx -doc -font-server -insecure-drivers +ipv6 -minimal +mmx +nls -nocxx +opengl +pam -sdk +sse -static +truetype-fonts +type1-fonts (-uclibc) -xprint +xv 0 kB [ebuild N ] media-libs/fontconfig-2.3.2 0 kB [ebuild N ] x11-misc/ttmkfdir-3.0.9-r3 0 kB [ebuild N ] x11-base/opengl-update-3.0.0 0 kB [ebuild N ] app-admin/eselect-opengl-1.0.2-r1 0 kB [ebuild N ] app-admin/eselect-0.9.6 -bash-completion -doc 0 kB [ebuild N ] app-arch/bzip2-1.0.3-r5 -build -static 0 kB [ebuild N ] sys-apps/util-linux-2.12r +crypt +nls -old-crypt +pam +perl (-selinux) -static 0 kB [ebuild N ] app-crypt/hashalot-0.3 78 kB [ebuild N ] sys-fs/e2fsprogs-1.38 +nls -static 0 kB [ebuild N ] sys-libs/ss-1.38 +nls 0 kB [ebuild N ] sys-libs/com_err-1.38 +nls 0 kB [ebuild N ] sys-apps/pam-login-4.0.12 -livecd +nls (-selinux) 0 kB [ebuild N ] sys-apps/shadow-4.0.12 +nls -nousuid +pam (-selinux) +skey 0 kB [ebuild N ] sys-libs/pam-0.78-r2 +berkdb -nis -pam_chroot -pam_console -pam_timestamp -pwdb (-selinux) 6,345 kB [ebuild N ] dev-util/pkgconfig-0.19 -hardened 0 kB [ebuild N ] sys-devel/flex-2.5.4a-r6 -build -static 0 kB [ebuild N ] sys-apps/portage-2.0.53_rc4 -build (-selinux) 0 kB [ebuild N ] sys-apps/debianutils-2.14.1-r1 -build -static 0 kB [ebuild N ] sys-apps/sandbox-1.2.13 0 kB [ebuild N ] dev-python/python-fchksum-1.7.1 26 kB [ebuild N ] dev-lang/python-2.4.2 +X +berkdb -bootstrap -build -doc +gdbm +ipv6 +ncurses -nocxx +readline +ssl +tcltk -ucs2 0 kB [ebuild N ] dev-lang/tk-8.4.11 -threads 0 kB [ebuild N ] dev-libs/openssl-0.9.7g -bindist +emacs -test +zlib 0 kB [ebuild N ] sys-apps/diffutils-2.8.7-r1 +nls -static 1,037 kB [ebuild N ] sys-libs/readline-5.0-r2 1,777 kB [ebuild N ] dev-libs/expat-1.95.8 -test 310 kB [ebuild N ] app-admin/skey-1.1.5-r5 0 kB [ebuild N ] sys-libs/cracklib-2.8.5 +python 0 kB [ebuild N ] media-libs/libpng-1.2.8 -doc 0 kB [ebuild N ] media-libs/jpeg-6b-r6 0 kB [ebuild N ] sys-devel/libtool-1.5.20 0 kB [ebuild N ] sys-devel/automake-1.9.6-r1 0 kB [ebuild N ] sys-devel/automake-wrapper-1-r1 0 kB [ebuild N ] sys-devel/automake-1.4_p6 366 kB [ebuild N ] sys-devel/automake-1.7.9-r1 564 kB [ebuild N ] sys-devel/automake-1.6.3 465 kB [ebuild N ] sys-devel/automake-1.8.5-r3 647 kB [ebuild N ] app-admin/perl-cleaner-1.01 3 kB [ebuild N ] sys-devel/automake-1.5 514 kB [ebuild N ] sys-devel/autoconf-2.59-r7 +emacs 0 kB [ebuild N ] sys-devel/autoconf-wrapper-3.2 0 kB [ebuild N ] sys-devel/autoconf-2.13 433 kB [ebuild N ] dev-lang/perl-5.8.7-r1 +berkdb -build -debug -doc +gdbm -ithreads -minimal -perlsuid 0 kB [ebuild N ] sys-devel/libperl-5.8.7 +berkdb -debug +gdbm -ithreads 0 kB [ebuild N ] sys-libs/gdbm-1.8.3-r2 +berkdb 0 kB [ebuild N ] sys-apps/man-1.6a +nls 0 kB [ebuild N ] sys-process/cronbase-0.3.2 0 kB [ebuild N ] sys-apps/groff-1.19.1-r2 +X 2,567 kB [ebuild N ] sys-libs/db-4.2.52_p2 -bootstrap -doc -java -nocxx +tcltk 0 kB [ebuild N ] dev-lang/tcl-8.4.11 -threads 0 kB [ebuild N ] media-libs/freetype-2.1.10 -bindist -doc +zlib 0 kB [ebuild N ] sys-libs/glibc-2.3.5-r2 -build -erandom -glibc-compat20 -glibc-omitfp -hardened -linuxthreads-tls (-multilib) +nls +nptl -nptlonly -pic -profile (-selinux) +userlocales 0 kB [ebuild N ] sys-kernel/linux-headers-2.6.11-r2 36,238 kB [ebuild N ] sys-devel/gcc-3.3.6 (-altivec) -bootstrap -boundschecking -build -fortran -gcj +gtk -hardened -ip28 (-multilib) -multislot (-n32) (-n64) +nls -nocxx -nopie -nossp -objc -static -vanilla 0 kB [ebuild N ] sys-devel/gcc-3.4.4-r1 (-altivec) -bootstrap -boundschecking -build -fortran -gcj +gtk -hardened -ip28 (-multilib) -multislot (-n32) (-n64) +nls -nocxx -nopie -nossp -objc -static -vanilla 0 kB [ebuild N ] sys-devel/gcc-config-1.3.12-r2 0 kB [ebuild N ] sys-apps/texinfo-4.8-r2 -build +nls -static 0 kB [ebuild N ] sys-apps/sed-4.1.4 -bootstrap -build +nls -static 775 kB [ebuild N ] sys-devel/bison-2.1 +nls -static 0 kB [ebuild N ] sys-devel/m4-1.4.3 +nls 0 kB [ebuild N ] sys-devel/binutils-2.16.1 -multislot -multitarget +nls -test 0 kB [ebuild N ] sys-devel/gettext-0.14.5 -doc +emacs +nls 0 kB [ebuild N ] sys-devel/gnuconfig-20050602 0 kB [ebuild N ] sys-devel/binutils-config-1.8-r5 0 kB [ebuild N ] app-shells/bash-3.0-r12 -bashlogger -build +nls 2,404 kB [ebuild N ] sys-libs/ncurses-5.4.20050319 -bootstrap -build -debug -doc +gpm -minimal -nocxx +unicode 0 kB [ebuild N ] sys-libs/gpm-1.20.1-r5 +emacs (-selinux) 0 kB [ebuild N ] sys-libs/zlib-1.2.3 -build 415 kB [ebuild N ] sys-devel/patch-2.5.9-r1 -build -static 0 kB Total size of downloads: 82,409 kB Notice how dev-db/mysql is emerged after x11-libs/qt even though the later has an explicit dependency on the former. I just had an emerge abort because of that one. I have had several such odd experiences, for example with tk which was scheduled for emerging before x11-org on which it depends. etc... Here is my "portage --info", but don't be surprised with the uname info: I am currently booted into kubuntu, with gentoo installing in a chroot: Portage 2.0.53_rc4 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2, 2.6.12-9-386 i686) ================================================================= System uname: 2.6.12-9-386 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz Gentoo Base System version 1.12.0_pre8 dev-lang/python: 2.3.5, 2.4.2 sys-apps/sandbox: 1.2.13 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="en_US.UTF-8" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 X X509 alsa apm arts audiofile avi berkdb bitmap-fonts bzip2 crypt cups curl dbus dga directfb eds emacs emboss encode fbcon flac foomaticdb gdbm gif gphoto2 gpm gstreamer gtk gtk2 hal ieee1394 imlib ipv6 jpeg jpeg2k kde ldap libg++ libwww lirc mad mikmod mmap mmx motif mp3 mpeg mpi musicbrainz mysql ncurses nls nptl odbc ogg oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sasl sdl skey slp sndfile speex spell sqlite sse sse2 ssl svga tcltk tcpd tetex theora tiff truetype truetype-fonts type1-fonts unicode usb vorbis wifi xine xml2 xmms xv zeroconf zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
"These are the packages that I would merge, __in reverse order__"
Ehm, that might not be clear enough: a) --tree screws the order up, don't use it if you want to say anything about order b) --emtpytree screws the depgraph as it includes "system", so you're not getting a "pure" qt depgraph.
Not quite..
*** This bug has been marked as a duplicate of 16365 ***
(In reply to comment #2) Ehm back at you :-) a) --tree makes no difference to the problem as you can easily verify b) forgive the truism, but dependencies are dependencies, regardless of the root set of packages with which the algorithm is started to compute the relevant part of the dependency graph