aboutsummaryrefslogtreecommitdiff
path: root/release
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-10-21 14:07:02 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-10-21 14:07:02 +0000
commit7dace4c581184e345780915eabc0f26ac64c93f1 (patch)
treea098148a84ba23c28f00ddf91ed6862e5d5ccc56 /release
parenta9076ea0bcc7ced5f9d9b6d99d22dcbf7aa047fe (diff)
downloadsrc-7dace4c581184e345780915eabc0f26ac64c93f1.tar.gz
src-7dace4c581184e345780915eabc0f26ac64c93f1.zip
1. Of course, the day after you roll the snapshots is the day you realize
that the FTP install doesn't deal with timeouts and hasn't since it was written. Fixed. 2. Totally eliminate the OptionFlags. I only had to work harder to sync them with configuration variables, so why not simply always use configuration variables? This has actually greatly simplified areas of the code.
Notes
Notes: svn path=/head/; revision=11614
Diffstat (limited to 'release')
-rw-r--r--release/sysinstall/index.c4
-rw-r--r--release/sysinstall/options.c47
2 files changed, 10 insertions, 41 deletions
diff --git a/release/sysinstall/index.c b/release/sysinstall/index.c
index f5c3c79fcf71..8cf6fa0e66d9 100644
--- a/release/sysinstall/index.c
+++ b/release/sysinstall/index.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: index.c,v 1.11 1995/10/20 07:02:34 jkh Exp $
+ * $Id: index.c,v 1.13 1995/10/20 21:57:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -558,7 +558,7 @@ index_extract(Device *dev, PkgNodePtr plist)
for (tmp = plist->kids; tmp; tmp = tmp->next) {
if (package_extract(dev, tmp->name) != RET_SUCCESS) {
- if (optionIsSet(OPT_NO_CONFIRM))
+ if (variable_get(OPT_NO_CONFIRM))
msgNotify("Unable to locate package %s..", tmp->name);
else
msgConfirm("Unable to locate package %s..", tmp->name);
diff --git a/release/sysinstall/options.c b/release/sysinstall/options.c
index 7ebb7c2d0809..102cb8f5cb9d 100644
--- a/release/sysinstall/options.c
+++ b/release/sysinstall/options.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
- * $Id: options.c,v 1.16 1995/10/20 07:02:46 jkh Exp $
+ * $Id: options.c,v 1.19 1995/10/20 14:25:01 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -45,17 +45,6 @@
#include <ctype.h>
static char *
-ftpFlagCheck(Option opt)
-{
- /* Verify that everything's sane */
- if ((int)opt.aux == OPT_FTP_ABORT && optionIsSet(OPT_FTP_RESELECT))
- optionUnset(OPT_FTP_RESELECT);
- else if ((int)opt.aux == OPT_FTP_RESELECT && optionIsSet(OPT_FTP_ABORT))
- optionUnset(OPT_FTP_ABORT);
- return (*(int *)opt.data) & (int)opt.aux ? "ON" : "OFF";
-}
-
-static char *
varCheck(Option opt)
{
if (opt.aux)
@@ -71,12 +60,6 @@ resetLogo(char *str)
}
static char *
-debugCheck(char *str)
-{
- return isDebug() ? "ON" : "OFF";
-}
-
-static char *
mediaCheck(Option opt)
{
if (mediaDevice) {
@@ -115,21 +98,19 @@ mediaCheck(Option opt)
static Option Options[] = {
{ "NFS Secure", "NFS server talks only on a secure port",
- OPT_IS_FLAG, &OptFlags, (void *)OPT_NFS_SECURE, NULL },
+ OPT_IS_VAR, "Set if your server refuses to talk to you (usually Suns)", OPT_NFS_SECURE, varCheck },
{ "NFS Slow", "User is using a slow PC or ethernet card",
- OPT_IS_FLAG, &OptFlags, (void *)OPT_SLOW_ETHER, NULL },
+ OPT_IS_VAR, "Set if your cheap PC ethernet card is dropping NFS packets", OPT_SLOW_ETHER, varCheck },
{ "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)",
- OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, debugCheck },
+ OPT_IS_VAR, "Turn this on for more info if you're experiencing any weirdness", OPT_DEBUG, varCheck },
{ "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs",
- OPT_IS_FLAG, &OptFlags, (void *)OPT_NO_CONFIRM, NULL },
-{ "FTP Abort", "On transfer failure, abort the installation of a distribution",
- OPT_IS_FLAG, &OptFlags, (void *)OPT_FTP_ABORT, ftpFlagCheck },
-{ "FTP Reselect", "On transfer failure, ask for another host and try to resume",
- OPT_IS_FLAG, &OptFlags, (void *)OPT_FTP_RESELECT, ftpFlagCheck },
+ OPT_IS_VAR, "This is a good idea for unattended installation.", OPT_NO_CONFIRM, varCheck },
+{ "FTP OnError", "What to do when FTP requests fail: abort, retry, reselect.",
+ OPT_IS_FUNC, mediaSetFtpOnError, OPT_FTP_ONERROR, varCheck },
{ "FTP username", "Username and password to use instead of anonymous",
OPT_IS_FUNC, mediaSetFtpUserPass, FTP_USER, varCheck },
{ "Tape Blocksize", "Tape media block size in 512 byte blocks",
- OPT_IS_VAR, "Please enter the tape block size in 512 byte blocks", TAPE_BLOCKSIZE, varCheck },
+ OPT_IS_VAR, "Please enter the tape block size in 512 byte blocks", TAPE_BLOCKSIZE, varCheck },
{ "Extract Detail", "How verbosely to display file name information during extractions",
OPT_IS_FUNC, mediaSetCPIOVerbosity, CPIO_VERBOSITY_LEVEL, varCheck },
{ "Release Name", "Which release to attempt to load from installation media",
@@ -153,18 +134,6 @@ static Option Options[] = {
#define OPT_VALUE_COL 16
#define GROUP_OFFSET 40
-Boolean
-optionIsSet(int opt)
-{
- return OptFlags & opt;
-}
-
-void
-optionUnset(int opt)
-{
- OptFlags &= ~opt;
-}
-
static char *
value_of(Option opt)
{