The huge dependency lists of some of our packages has brought

attention to the sub-optimal way that we deal with package
dependencies.  Traditionally, for each package in an INDEX that the
user wants to add, we check all of the dependencies first even if the
package is already installed.  With some GNOME packages, this can
cause package_extract to be called for 50 different dependencies when
we know the top level package is already installed.

The new behavior is to not check dependencies for packages that are
already installed.  This fixes a bug where sysinstall gets itself into
a CPU intensive loop when trying to install sawfish gnome with the
most recent ports/INDEX.  There is a bug somewhere in the ports INDEX,
but with over 6,400 ports we need to be a little more forgiving here.
This commit is contained in:
Murray Stokely 2002-01-29 21:41:08 +00:00
parent 8aa32802b9
commit 1dde8e0111

View File

@ -640,6 +640,19 @@ index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended)
IndexEntryPtr id = who->data;
WINDOW *w = savescr();
/*
* Short-circuit the package dependency checks. We're already
* maintaining a data structure of installed packages, so if a
* package is already installed, don't try to check to make sure
* that all of its dependencies are installed. At best this
* wastes a ton of cycles and can cause minor delays between
* package extraction. At worst it can cause an infinite loop with
* a certain faulty INDEX file.
*/
if (id->installed == 1)
return DITEM_SUCCESS;
if (id && id->deps && strlen(id->deps)) {
char t[1024], *cp, *cp2;