From owner-svn-src-stable@FreeBSD.ORG Sat Aug 7 12:51:45 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00A41106564A; Sat, 7 Aug 2010 12:51:45 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2A8F8FC1F; Sat, 7 Aug 2010 12:51:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o77Cpifc044108; Sat, 7 Aug 2010 12:51:44 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o77Cpiwo044105; Sat, 7 Aug 2010 12:51:44 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201008071251.o77Cpiwo044105@svn.freebsd.org> From: Bruce Cran Date: Sat, 7 Aug 2010 12:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211011 - stable/8/usr.sbin/sysinstall X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Aug 2010 12:51:45 -0000 Author: brucec Date: Sat Aug 7 12:51:44 2010 New Revision: 211011 URL: http://svn.freebsd.org/changeset/base/211011 Log: MFC r209468: Make it easier to cancel a failing installation by only attempting to extract distributions once. If a distribution fails to fetch/extract and the user doesn't want to retry, abort the installation. Approved by: rrs (mentor) Modified: stable/8/usr.sbin/sysinstall/dist.c stable/8/usr.sbin/sysinstall/install.c Directory Properties: stable/8/usr.sbin/sysinstall/ (props changed) Modified: stable/8/usr.sbin/sysinstall/dist.c ============================================================================== --- stable/8/usr.sbin/sysinstall/dist.c Sat Aug 7 12:46:49 2010 (r211010) +++ stable/8/usr.sbin/sysinstall/dist.c Sat Aug 7 12:51:44 2010 (r211011) @@ -613,7 +613,7 @@ getinfo: if (fp == NULL) msgConfirm("Failed to find %s on this media. Reinitializing media.", fname); else - msgConfirm("Failed to retreive piece file %s.\n" + msgConfirm("Failed to retrieve piece file %s.\n" "%s: Reinitializing media.", fname, !intr ? "I/O error" : "User interrupt"); DEVICE_SHUTDOWN(mediaDevice); @@ -709,6 +709,7 @@ distExtract(char *parent, Distribution * char *path, *dist; WINDOW *w = savescr(); struct sigaction old, new; + int canceled = 0; status = TRUE; if (isDebug()) @@ -723,7 +724,7 @@ distExtract(char *parent, Distribution * sigaction(SIGINT, &new, &old); /* Loop through to see if we're in our parent's plans */ - for (i = 0; me[i].my_name; i++) { + for (i = 0; me[i].my_name && canceled == 0; i++) { dist = me[i].my_name; path = parent ? parent : dist; @@ -758,8 +759,11 @@ distExtract(char *parent, Distribution * status = msgYesNo("Unable to transfer the %s distribution from\n%s.\n\n" "Do you want to try to retrieve it again?", me[i].my_name, mediaDevice->name); - if (!status) + if (status == 0) --i; + else + canceled = 1; + status = FALSE; } } @@ -773,6 +777,7 @@ distExtract(char *parent, Distribution * if (status) *(me[i].my_mask) &= ~(me[i].my_bit); } + sigaction(SIGINT, &old, NULL); /* Restore signal handler */ restorescr(w); return status; @@ -865,8 +870,9 @@ printSelected(char *buf, int selected, D int distExtractAll(dialogMenuItem *self) { - int old_dists, old_kernel, retries = 0, status = DITEM_SUCCESS; + int old_dists, old_kernel, status = DITEM_SUCCESS; char buf[512]; + int extract_status = TRUE; WINDOW *w; /* paranoia */ @@ -886,9 +892,7 @@ distExtractAll(dialogMenuItem *self) w = savescr(); msgNotify("Attempting to install all selected distributions.."); - /* Try for 3 times around the loop, then give up. */ - while (Dists && ++retries < 3) - distExtract(NULL, DistTable); + extract_status = distExtract(NULL, DistTable); dialog_clear_norefresh(); /* Only do base fixup if base dist was successfully extracted */ @@ -915,5 +919,9 @@ distExtractAll(dialogMenuItem *self) } } restorescr(w); + + if (extract_status == FALSE) + status = DITEM_FAILURE; + return status; } Modified: stable/8/usr.sbin/sysinstall/install.c ============================================================================== --- stable/8/usr.sbin/sysinstall/install.c Sat Aug 7 12:46:49 2010 (r211010) +++ stable/8/usr.sbin/sysinstall/install.c Sat Aug 7 12:51:44 2010 (r211011) @@ -676,8 +676,7 @@ nodisks: msgConfirm("Installation completed with some errors. You may wish to\n" "scroll through the debugging messages on VTY1 with the\n" "scroll-lock feature. You can also choose \"No\" at the next\n" - "prompt and go back into the installation menus to retry\n" - "whichever operations have failed."); + "prompt and reboot and try the installation again."); return i; } @@ -853,6 +852,9 @@ try_media: /* Now go get it all */ i = distExtractAll(self); + if (i == FALSE) + return FALSE; + /* When running as init, *now* it's safe to grab the rc.foo vars */ installEnvironment();