summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authormurray <murray@FreeBSD.org>2002-01-29 21:41:08 +0000
committermurray <murray@FreeBSD.org>2002-01-29 21:41:08 +0000
commit96cd8b4b8c2be7b8c774afa52e7716ff726b4e35 (patch)
tree461d80416bbecf5d3d6f467950cdcd7ecb9e9c82 /usr.sbin
parent7ef8eab2e29c9b89340055b3d3d49e104c0e4a03 (diff)
downloadFreeBSD-src-96cd8b4b8c2be7b8c774afa52e7716ff726b4e35.zip
FreeBSD-src-96cd8b4b8c2be7b8c774afa52e7716ff726b4e35.tar.gz
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.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sysinstall/index.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/usr.sbin/sysinstall/index.c b/usr.sbin/sysinstall/index.c
index b3ca29e..bc6f3f8 100644
--- a/usr.sbin/sysinstall/index.c
+++ b/usr.sbin/sysinstall/index.c
@@ -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;
OpenPOWER on IntegriCloud