From baddd88f3fd948a5505e14b2c25e378fb386ea59 Mon Sep 17 00:00:00 2001 From: Ken Smith Date: Sun, 19 Nov 2006 08:12:54 +0000 Subject: [PATCH] Move the check for which disc volume we have/want to after we install the package dependencies. Installation of the dependencies may leave us on the wrong disc volume. MFC after: 3 days --- usr.sbin/sysinstall/index.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/usr.sbin/sysinstall/index.c b/usr.sbin/sysinstall/index.c index a20dfb4621a9..34d42f869265 100644 --- a/usr.sbin/sysinstall/index.c +++ b/usr.sbin/sysinstall/index.c @@ -692,25 +692,6 @@ index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended) if (id->installed == 1) return DITEM_SUCCESS; - /* - * Prompt user if the package is not available on the current volume. - */ - - if(mediaDevice->type == DEVICE_TYPE_CDROM) { - while (id->volume != dev->volume) { - if (!msgYesNo("This is disc #%d. Package %s is on disc #%d\n" - "Would you like to switch discs now?\n", dev->volume, - id->name, id->volume)) { - DEVICE_SHUTDOWN(mediaDevice); - msgConfirm("Please remove disc #%d from your drive, and add disc #%d\n", - dev->volume, id->volume); - DEVICE_INIT(mediaDevice); - } else { - return DITEM_FAILURE; - } - } - } - if (id && id->deps && strlen(id->deps)) { char t[2048 * 8], *cp, *cp2; @@ -742,6 +723,21 @@ index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended) } /* Done with the deps? Load the real m'coy */ if (DITEM_STATUS(status) == DITEM_SUCCESS) { + /* Prompt user if the package is not available on the current volume. */ + if(mediaDevice->type == DEVICE_TYPE_CDROM) { + while (id->volume != dev->volume) { + if (!msgYesNo("This is disc #%d. Package %s is on disc #%d\n" + "Would you like to switch discs now?\n", dev->volume, + id->name, id->volume)) { + DEVICE_SHUTDOWN(mediaDevice); + msgConfirm("Please remove disc #%d from your drive, and add disc #%d\n", + dev->volume, id->volume); + DEVICE_INIT(mediaDevice); + } else { + return DITEM_FAILURE; + } + } + } status = package_extract(dev, who->name, depended); if (DITEM_STATUS(status) == DITEM_SUCCESS) id->installed = 1;