When I do a pretend update of docbook-sgml-utils, I get the following output: bash-2.05b# emerge -up docbook-sgml-utils These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild N ] net-www/lynx-2.8.4.1c [ebuild U ] app-text/docbook-sgml-utils-0.6.12 [0.6.11-r2] However, the ebuild for docbook-sgml-utils-0.6.12 specifies a dependency on net-www/lynx OR net-www/links. I already have links installed on my system: bash-2.05b# emerge -up net-www/links These are the packages that I would merge, in order: Calculating dependencies ...done! Thus the dependency should be satisified and there should be no reason to install lynx. Stepping through portage.py with pdb, I found that dep_wordreduce was reducing the deplist to all zeros, even though all the dependencies were satisfied. This causes dep_zapdeps to return all the packages that docbook-sgml-utils depends on, instead of just the ones that are not yet installed. By default, dep_zapdeps picks the first entry of an unsatisfied || dependency, so lynx is included in the returned list. I have not followed the code beyond this point, but the installed dependencies must be getting filtered out or ignored at some later point. However, as lynx is not installed, it remains and portage wants to install it. Reproducible: Always Steps to Reproduce: Portage 2.0.49-r3 (default-1.0, gcc-2.95.3, glibc-2.2.5-r8, 2.4.19-gentoo-r9) ================================================================= System uname: 2.4.19-gentoo-r9 i686 AMD Athlon(tm) ccache version 2.2 [enabled] ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=i686 -mwide-multiply -O3 -fforce-addr -pipe" CHOST="i686-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=i686 -mwide-multiply -O3 -fforce-addr -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="sandbox autoaddcvs ccache fixpackages" GENTOO_MIRRORS="ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://csociety-ftp.ecn.purdue.edu/pub/gentoo/ ftp://mirror.iawnet.sandia.gov/pub/gentoo/ http://distro.ibiblio.org/gentoo " MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage-overlay" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="x86 oss 3dnow avi crypt cups encode jpeg libg++ mmx mpeg ncurses pdflib quicktime slang spell truetype xml2 xv alsa cdr directfb gdbm gif gnome-libs gpm gtk imlib java libwww motif mozilla nas oggvorbis opengl pam perl python qt readline sdl ssl svga tcltk tetex tiff X dga doc fbcon gd gtk2 gtkhtml guile imap jikes moznocompose moznoirc mozsvg mozxmlterm mpi plotutils rage128 samba vim-with-x wmf zlib -apm -arts -kde -mikmod -xmms -berkdb -esd -nls -png -tcpd"
*** Bug 29726 has been marked as a duplicate of this bug. ***
Created attachment 20197 [details, diff] patch for portage.py Fixed.
Created attachment 20203 [details, diff] patch for portage.py Sorry! I didn't think about 3 or more dependency.
The patch appears to fix the symptom, but I believe that there is a deeper problem that should be addressed, namely that dep_wordreduce is not reducing the deplist correctly. The existing logic in dep_zapdeps and dep_eval is correct for handing || dependencies, provided that dep_zapdeps is provided a properly reduced deplist. I will try to look into this again, although in my first investigation I was not able find the root of the problem. I was able to step through the execution of dep_wordreduce, but it was not clear at which point the behavior deviated from what it should have been.
OK. I just looked into portage.py again. I think I fixed the problem more deeply :) What do you think? *** I explain why this bug happens: This problem happens when you set '-u' option and not first package in || dependecy is installed. portage builds entire tree and then removes the files which are alrealy installed when you set -u. portage always add first package in || dependecy to the entire tree even if it's not installed. In this case, || ( net-www/lynx net-www/links ) portage adds net-www/lynx to the entire tree. But net/www/lynx will not be removed because it's not being installed. portage should add net-www/links to the entire tree. I've corrected this point.
Created attachment 20261 [details, diff] patch for portage.py
Created attachment 20278 [details, diff] patch for portage.py Masatomo - thanks for your explanation. I now understand why dep_wordreduce is behaving the way it does. I've also made some minor improvements to your patch - the comments in dep_zapdeps have been updated, and dep_zapdeps creates only a single vardbapi object.
I modified it a bit more and remove the need to create a vardbapi at all. db[root]["vartree"].dbapi Included for -r17,
*** Bug 33451 has been marked as a duplicate of this bug. ***
*** Bug 30997 has been marked as a duplicate of this bug. ***
this bug occurs again with portage-2.0.50-r2, it want's to install libelf although elfutils is already installed (ntp dependencie)
According to the documentation, the || dependencies should be checked in order. With the ntp dependencies, I also would expect an already installed dep to be utilized. However, there's two camps on this one and the existing documentation points the other way. Check bug 46005.
seems to be fixed in -r3 again