aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorMurray Stokely <murray@FreeBSD.org>2002-01-29 21:41:08 +0000
committerMurray Stokely <murray@FreeBSD.org>2002-01-29 21:41:08 +0000
commit1dde8e011146a20b427e7deb44f7c8343daa360e (patch)
tree461d80416bbecf5d3d6f467950cdcd7ecb9e9c82 /usr.sbin/sysinstall
parent8aa32802b9cdb0a9ccf58a265b4860f33c7e997e (diff)
downloadsrc-1dde8e011146a20b427e7deb44f7c8343daa360e.tar.gz
src-1dde8e011146a20b427e7deb44f7c8343daa360e.zip
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.
Notes
Notes: svn path=/head/; revision=89966
Diffstat (limited to 'usr.sbin/sysinstall')
-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 b3ca29e2352e..bc6f3f80ca73 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;