Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 29849 - || dependencies do not work
Summary: || dependencies do not work
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: Inclusion
: 29726 33451 (view as bug list)
Depends on:
Blocks: 32290
  Show dependency tree
 
Reported: 2003-09-28 18:04 UTC by Daniel Harding
Modified: 2011-10-30 22:20 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for portage.py (bugs.29849.patch,422 bytes, patch)
2003-11-03 13:53 UTC, Masatomo Nakano (RETIRED)
Details | Diff
patch for portage.py (bugs.29849.patch,318 bytes, patch)
2003-11-03 15:15 UTC, Masatomo Nakano (RETIRED)
Details | Diff
patch for portage.py (bugs.29849.patch,638 bytes, patch)
2003-11-04 11:50 UTC, Masatomo Nakano (RETIRED)
Details | Diff
patch for portage.py (portage.py.patch,769 bytes, patch)
2003-11-04 20:30 UTC, Daniel Harding
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Harding 2003-09-28 18:04:37 UTC
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"
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2003-09-28 23:43:07 UTC
*** Bug 29726 has been marked as a duplicate of this bug. ***
Comment 2 Masatomo Nakano (RETIRED) gentoo-dev 2003-11-03 13:53:49 UTC
Created attachment 20197 [details, diff]
patch for portage.py

Fixed.
Comment 3 Masatomo Nakano (RETIRED) gentoo-dev 2003-11-03 15:15:45 UTC
Created attachment 20203 [details, diff]
patch for portage.py

Sorry!
I didn't think about 3 or more dependency.
Comment 4 Daniel Harding 2003-11-03 20:45:24 UTC
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.
Comment 5 Masatomo Nakano (RETIRED) gentoo-dev 2003-11-04 11:49:16 UTC
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.
Comment 6 Masatomo Nakano (RETIRED) gentoo-dev 2003-11-04 11:50:43 UTC
Created attachment 20261 [details, diff]
patch for portage.py
Comment 7 Daniel Harding 2003-11-04 20:30:59 UTC
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.
Comment 8 Nicholas Jones (RETIRED) gentoo-dev 2003-11-09 21:59:30 UTC
I modified it a bit more and remove the need to create a
vardbapi at all.   db[root]["vartree"].dbapi

Included for -r17, 
Comment 9 Marius Mauch (RETIRED) gentoo-dev 2003-11-14 08:49:14 UTC
*** Bug 33451 has been marked as a duplicate of this bug. ***
Comment 10 SpanKY gentoo-dev 2003-11-15 22:17:48 UTC
*** Bug 30997 has been marked as a duplicate of this bug. ***
Comment 11 Heinrich Wendel (RETIRED) gentoo-dev 2004-03-29 06:07:49 UTC
this bug occurs again with portage-2.0.50-r2, it want's to install libelf although elfutils is already installed (ntp dependencie)
Comment 12 Jason Stubbs (RETIRED) gentoo-dev 2004-03-29 16:05:55 UTC
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.
Comment 13 Heinrich Wendel (RETIRED) gentoo-dev 2004-04-05 05:02:19 UTC
seems to be fixed in -r3 again