pena baselayout-trunk # emerge -pvt glib-java These are the packages that would be merged, in reverse order: Calculating dependencies... done! [ebuild N ] dev-java/glib-java-0.2.6 USE="-doc -gcj -source" 324 kB [ebuild NS ] virtual/jre-1.6.0 0 kB [ebuild NS ] virtual/jdk-1.6.0 0 kB sqlite> select DEPEND, portage_package_key from portage_packages where portage_package_key="dev-java/glib-java-0.2.6"; >=dev-libs/glib-2.8.1 >=dev-java/java-config-2.0.19-r1 >=sys-apps/portage-2.1_pre1 >=virtual/jdk-1.4 source? ( app-arch/zip ) dev-util/pkgconfig|dev-java/glib-java-0.2.6 Because I did not have --deep in there and there is no need for jdk-1.6 here Portage should not pull in 1.6.0 for me. pena baselayout-trunk # emerge --info Portage 2.1.2_rc3-r6 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.19-gentoo-r2 i686) ================================================================= System uname: 2.6.19-gentoo-r2 i686 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz Gentoo Base System version 1.13.0_alpha9 Last Sync: Unknown distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [enabled] dev-java/java-config: 1.3.7, 2.0.30 dev-lang/python: 2.4.4, 2.5-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r6 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.14 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.17-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=nocona -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo" CXXFLAGS="-O2 -march=nocona -pipe" DISTDIR="/var/distfiles" FEATURES="autoaddcvs autoconfig ccache collision-protect cvs distlocks fixpackages java-strict parallel-fetch sandbox sfperms sign strict stricter userpriv usersandbox verify-rdepend" GENTOO_MIRRORS=" http://trumpetti.atm.tut.fi/gentoo http://lame.lut.fi/linux/gentoo " LANG="en_US.utf8" LC_ALL="en_US.utf-8" LDFLAGS="-Wl,--as-needed" LINGUAS="fi" MAKEOPTS="-j2" PKGDIR="/home/pkg/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/mnt/checkouts/overlays/migrated-java" SYNC="rsync://192.168.150.1:/portage" USE="x86 aac acl acpi alsa alsa_cards_cs46xx alsa_cards_hda-intel arts audiofile bash-completion berkdb bitmap-fonts bluetooth bzip2 cairo cdb cddb cdparanoia cdr cli cracklib crypt cups dbus dlloader dri dts dvd dvdr dvdread elibc_glibc emboss esd fam ffmpeg firefox gif gstreamer hal iconv input_devices_evdev input_devices_keyboard input_devices_mouse isdnlog java jpeg kde kdeenablefinal kdehiddenvisibility kernel_linux libg++ linguas_fi logitech-mouse mad mikmod mjpeg mmx mp3 mpeg ncurses network nptl nptlonly nsplugin nvidia offensive ogg opengl pam pcre png ppds pppd qt3 quicktime readline real reflection rtc samba session spell spl sse sse2 ssl subversion svg symlink theora threads truetype truetype-fonts type1-fonts udev unicode usb userland_GNU userlocales video_cards_none video_cards_nvidia vim-syntax vorbis xcomposite xinerama xml xorg xv xvid xvmc zlib" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_RSYNC_EXTRA_OPTS
The current dep selection algorithm always pulls in the highest available match even if something installed already satisfies the dep. Eventually we'll turn on --deep by default and provide a separate dep selection algorithm so that it won't try to upgrade things that are already satisfied unless you want it to.
I've just realized that the specific behavior that you've reported is triggered by the change in new-style virtuals handling for bug #141118. This type of behavior isn't entirely new though since it can be triggered by other sorts of dependencies. The root of the problem it that depgraph.select_dep() only sees the finally selected =virtual/jre-1.6.0 that comes out of the portage.dep_check() call. At that point, it has no way of knowing that virtual/jre-1.4.0 would also satisfy the original dependency.
I suppose I have same problem with virtual/mysql - packages which depends on it (php, proftpd, snort, ...) now (since update from portage-2.1.1-r2 to portage-2.1.2-r9) want to install virtual/mysql-5.0, although virtual/mysql-4.1 is installed and should be sufficient. I tried to post it as bug #166991 (and assumedly made several mistakes while doing it), you can look at my information there if needed.
*** Bug 181304 has been marked as a duplicate of this bug. ***
This is fixed by the code from bug #275945. Now packages aren't upgraded unless --update is specified.
*** This bug has been marked as a duplicate of bug 275945 ***