diff options
author | jkh <jkh@FreeBSD.org> | 1995-10-16 15:14:28 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-10-16 15:14:28 +0000 |
commit | 1c55fdbaae54fa424f0c2cd826657d24bab0cbab (patch) | |
tree | 50bc7f170b9457e6b406c14c9cae37eff14ef8e2 | |
parent | d29267034077955b981a4e54f7059e4d8bb11b58 (diff) | |
download | FreeBSD-src-1c55fdbaae54fa424f0c2cd826657d24bab0cbab.zip FreeBSD-src-1c55fdbaae54fa424f0c2cd826657d24bab0cbab.tar.gz |
Fix many more bogons, add some stuff to make the docs folk happy.
-rw-r--r-- | release/sysinstall/index.c | 4 | ||||
-rw-r--r-- | release/sysinstall/options.c | 68 | ||||
-rw-r--r-- | release/sysinstall/package.c | 8 | ||||
-rw-r--r-- | usr.sbin/sysinstall/index.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/options.c | 68 | ||||
-rw-r--r-- | usr.sbin/sysinstall/package.c | 8 |
6 files changed, 66 insertions, 94 deletions
diff --git a/release/sysinstall/index.c b/release/sysinstall/index.c index 47320444b..3965653 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.8 1995/10/16 07:31:00 jkh Exp $ + * $Id: index.c,v 1.9 1995/10/16 09:25:13 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -458,7 +458,7 @@ is_selected_in(char *name, char *result) break; } else { - ret = !strncmp(name, result, cp - result); + ret = !strncmp(name, result, cp - result - 1); if (ret) break; } diff --git a/release/sysinstall/options.c b/release/sysinstall/options.c index ac91acc..294c278 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.7 1995/10/11 00:54:01 jkh Exp $ + * $Id: options.c,v 1.8 1995/10/14 09:30:53 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -45,44 +45,22 @@ #include <ctype.h> static char * -userPassCheck(Option opt) -{ - char *cp = variable_get(FTP_USER); - - return cp ? cp : "ftp"; -} - -static char * ftpFlagCheck(Option opt) { /* Verify that everything's sane */ - if (opt.aux == OPT_FTP_ABORT && optionIsSet(OPT_FTP_RESELECT)) + if ((int)opt.aux == OPT_FTP_ABORT && optionIsSet(OPT_FTP_RESELECT)) OptFlags &= ~OPT_FTP_RESELECT; - else if (opt.aux == OPT_FTP_RESELECT && optionIsSet(OPT_FTP_ABORT)) + else if ((int)opt.aux == OPT_FTP_RESELECT && optionIsSet(OPT_FTP_ABORT)) OptFlags &= ~OPT_FTP_ABORT; return NULL; } static char * -blockSizeCheck(Option opt) +varCheck(Option opt) { - char *cp = variable_get(TAPE_BLOCKSIZE); - - return cp ? cp : DEFAULT_TAPE_BLOCKSIZE; -} - -static char * -releaseCheck(Option opt) -{ - /* This one is always defined */ - return variable_get(RELNAME); -} - -static char * -checkCpioVerbosity(Option opt) -{ - /* This one is always defined */ - return getenv(CPIO_VERBOSITY_LEVEL); + if (opt.aux) + return variable_get((char *)opt.aux); + return NULL; } /* Nuke all the flags */ @@ -102,25 +80,29 @@ resetLogo(char *str) static Option Options[] = { { "NFS Secure", "NFS server talks only on a secure port", - OPT_IS_FLAG, &OptFlags, OPT_NFS_SECURE, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_NFS_SECURE, NULL }, { "NFS Slow", "User is using a slow PC or ethernet card", - OPT_IS_FLAG, &OptFlags, OPT_SLOW_ETHER, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_SLOW_ETHER, NULL }, { "Debugging", "Emit extra debugging output on VTY1 (ALT-F2)", - OPT_IS_FLAG, &OptFlags, OPT_DEBUG, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, NULL }, { "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs", - OPT_IS_FLAG, &OptFlags, OPT_NO_CONFIRM, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_NO_CONFIRM, NULL }, { "FTP Abort", "On transfer failure, abort the installation of a distribution", - OPT_IS_FLAG, &OptFlags, OPT_FTP_ABORT, ftpFlagCheck }, + 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, OPT_FTP_RESELECT, ftpFlagCheck }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_FTP_RESELECT, ftpFlagCheck }, { "FTP username", "Username and password to use instead of anonymous", - OPT_IS_FUNC, mediaSetFtpUserPass, 0, userPassCheck }, + OPT_IS_FUNC, mediaSetFtpUserPass, FTP_USER, varCheck }, { "Tape Blocksize", "Tape media block size in 512 byte blocks", - OPT_IS_FUNC, mediaSetTapeBlocksize, 0, blockSizeCheck }, + OPT_IS_FUNC, mediaSetTapeBlocksize, TAPE_BLOCKSIZE, varCheck }, { "Detail Level", "How to display filenames on debug screen as CPIO extracts them", - OPT_IS_FUNC, mediaSetCPIOVerbosity, 0, checkCpioVerbosity }, + OPT_IS_FUNC, mediaSetCPIOVerbosity, CPIO_VERBOSITY_LEVEL, varCheck }, { "Release Name", "Which release to attempt to load from installation media", - OPT_IS_FUNC, installSelectRelease, 0, releaseCheck }, + OPT_IS_FUNC, installSelectRelease, RELNAME, varCheck }, +{ "Browser Package", "This is the browser package you wish to use for viewing HTML", + OPT_IS_FUNC, docSelectBrowserPkg, BROWSER_PACKAGE, varCheck }, +{ "Browser Binary", "This is the path to the main binary from the broswer package", + OPT_IS_FUNC, docSelectBrowserBin, BROWSER_BINARY, varCheck }, { "Reset Flags", "Reset all flag values to defaults", OPT_IS_FUNC, resetFlags, 0, resetLogo }, { NULL }, @@ -152,7 +134,7 @@ value_of(Option opt) return ival; case OPT_IS_FLAG: - return (*(int *)opt.data) & opt.aux ? "ON" : "OFF"; + return (*(int *)opt.data) & (int)opt.aux ? "ON" : "OFF"; case OPT_IS_FUNC: if (opt.check) @@ -168,10 +150,10 @@ fire(Option opt) { if (opt.type == OPT_IS_FLAG) { /* Toggle a flag */ - if (*((int *)opt.data) & opt.aux) - *((int *)opt.data) &= ~opt.aux; + if (*((int *)opt.data) & (int)opt.aux) + *((int *)opt.data) &= ~(int)opt.aux; else - *((int *)opt.data) |= opt.aux; + *((int *)opt.data) |= (int)opt.aux; } else if (opt.type == OPT_IS_FUNC) { int (*cp)(char *) = opt.data; diff --git a/release/sysinstall/package.c b/release/sysinstall/package.c index 082cd4e..f1cd085 100644 --- a/release/sysinstall/package.c +++ b/release/sysinstall/package.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.71.2.31 1995/10/15 04:37:05 jkh Exp $ + * $Id: package.c,v 1.1 1995/10/15 12:41:05 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -61,6 +61,10 @@ package_extract(Device *dev, char *name) char *where; int i, fd, ret; + /* Check to make sure it's not already there */ + if (!vsystem("pkg_info -e %s")) + return RET_SUCCESS; + if (!dev->init(dev)) return RET_FAIL; @@ -90,7 +94,7 @@ package_extract(Device *dev, char *name) close(fd); tpid = waitpid(tpid, &pstat, 0); if (vsystem("(pwd; cat +CONTENTS) | pkg_add %s-S", - variable_get(CPIO_VERBOSITY_LEVEL), "high") ? "-v " : "") + !strcmp(variable_get(CPIO_VERBOSITY_LEVEL), "high") ? "-v " : "")) msgConfirm("An error occurred while trying to pkg_add %s.\n" "Please check debugging screen for possible further details.", path); else diff --git a/usr.sbin/sysinstall/index.c b/usr.sbin/sysinstall/index.c index 47320444b..3965653 100644 --- a/usr.sbin/sysinstall/index.c +++ b/usr.sbin/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.8 1995/10/16 07:31:00 jkh Exp $ + * $Id: index.c,v 1.9 1995/10/16 09:25:13 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -458,7 +458,7 @@ is_selected_in(char *name, char *result) break; } else { - ret = !strncmp(name, result, cp - result); + ret = !strncmp(name, result, cp - result - 1); if (ret) break; } diff --git a/usr.sbin/sysinstall/options.c b/usr.sbin/sysinstall/options.c index ac91acc..294c278 100644 --- a/usr.sbin/sysinstall/options.c +++ b/usr.sbin/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.7 1995/10/11 00:54:01 jkh Exp $ + * $Id: options.c,v 1.8 1995/10/14 09:30:53 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -45,44 +45,22 @@ #include <ctype.h> static char * -userPassCheck(Option opt) -{ - char *cp = variable_get(FTP_USER); - - return cp ? cp : "ftp"; -} - -static char * ftpFlagCheck(Option opt) { /* Verify that everything's sane */ - if (opt.aux == OPT_FTP_ABORT && optionIsSet(OPT_FTP_RESELECT)) + if ((int)opt.aux == OPT_FTP_ABORT && optionIsSet(OPT_FTP_RESELECT)) OptFlags &= ~OPT_FTP_RESELECT; - else if (opt.aux == OPT_FTP_RESELECT && optionIsSet(OPT_FTP_ABORT)) + else if ((int)opt.aux == OPT_FTP_RESELECT && optionIsSet(OPT_FTP_ABORT)) OptFlags &= ~OPT_FTP_ABORT; return NULL; } static char * -blockSizeCheck(Option opt) +varCheck(Option opt) { - char *cp = variable_get(TAPE_BLOCKSIZE); - - return cp ? cp : DEFAULT_TAPE_BLOCKSIZE; -} - -static char * -releaseCheck(Option opt) -{ - /* This one is always defined */ - return variable_get(RELNAME); -} - -static char * -checkCpioVerbosity(Option opt) -{ - /* This one is always defined */ - return getenv(CPIO_VERBOSITY_LEVEL); + if (opt.aux) + return variable_get((char *)opt.aux); + return NULL; } /* Nuke all the flags */ @@ -102,25 +80,29 @@ resetLogo(char *str) static Option Options[] = { { "NFS Secure", "NFS server talks only on a secure port", - OPT_IS_FLAG, &OptFlags, OPT_NFS_SECURE, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_NFS_SECURE, NULL }, { "NFS Slow", "User is using a slow PC or ethernet card", - OPT_IS_FLAG, &OptFlags, OPT_SLOW_ETHER, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_SLOW_ETHER, NULL }, { "Debugging", "Emit extra debugging output on VTY1 (ALT-F2)", - OPT_IS_FLAG, &OptFlags, OPT_DEBUG, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, NULL }, { "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs", - OPT_IS_FLAG, &OptFlags, OPT_NO_CONFIRM, NULL }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_NO_CONFIRM, NULL }, { "FTP Abort", "On transfer failure, abort the installation of a distribution", - OPT_IS_FLAG, &OptFlags, OPT_FTP_ABORT, ftpFlagCheck }, + 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, OPT_FTP_RESELECT, ftpFlagCheck }, + OPT_IS_FLAG, &OptFlags, (void *)OPT_FTP_RESELECT, ftpFlagCheck }, { "FTP username", "Username and password to use instead of anonymous", - OPT_IS_FUNC, mediaSetFtpUserPass, 0, userPassCheck }, + OPT_IS_FUNC, mediaSetFtpUserPass, FTP_USER, varCheck }, { "Tape Blocksize", "Tape media block size in 512 byte blocks", - OPT_IS_FUNC, mediaSetTapeBlocksize, 0, blockSizeCheck }, + OPT_IS_FUNC, mediaSetTapeBlocksize, TAPE_BLOCKSIZE, varCheck }, { "Detail Level", "How to display filenames on debug screen as CPIO extracts them", - OPT_IS_FUNC, mediaSetCPIOVerbosity, 0, checkCpioVerbosity }, + OPT_IS_FUNC, mediaSetCPIOVerbosity, CPIO_VERBOSITY_LEVEL, varCheck }, { "Release Name", "Which release to attempt to load from installation media", - OPT_IS_FUNC, installSelectRelease, 0, releaseCheck }, + OPT_IS_FUNC, installSelectRelease, RELNAME, varCheck }, +{ "Browser Package", "This is the browser package you wish to use for viewing HTML", + OPT_IS_FUNC, docSelectBrowserPkg, BROWSER_PACKAGE, varCheck }, +{ "Browser Binary", "This is the path to the main binary from the broswer package", + OPT_IS_FUNC, docSelectBrowserBin, BROWSER_BINARY, varCheck }, { "Reset Flags", "Reset all flag values to defaults", OPT_IS_FUNC, resetFlags, 0, resetLogo }, { NULL }, @@ -152,7 +134,7 @@ value_of(Option opt) return ival; case OPT_IS_FLAG: - return (*(int *)opt.data) & opt.aux ? "ON" : "OFF"; + return (*(int *)opt.data) & (int)opt.aux ? "ON" : "OFF"; case OPT_IS_FUNC: if (opt.check) @@ -168,10 +150,10 @@ fire(Option opt) { if (opt.type == OPT_IS_FLAG) { /* Toggle a flag */ - if (*((int *)opt.data) & opt.aux) - *((int *)opt.data) &= ~opt.aux; + if (*((int *)opt.data) & (int)opt.aux) + *((int *)opt.data) &= ~(int)opt.aux; else - *((int *)opt.data) |= opt.aux; + *((int *)opt.data) |= (int)opt.aux; } else if (opt.type == OPT_IS_FUNC) { int (*cp)(char *) = opt.data; diff --git a/usr.sbin/sysinstall/package.c b/usr.sbin/sysinstall/package.c index 082cd4e..f1cd085 100644 --- a/usr.sbin/sysinstall/package.c +++ b/usr.sbin/sysinstall/package.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.71.2.31 1995/10/15 04:37:05 jkh Exp $ + * $Id: package.c,v 1.1 1995/10/15 12:41:05 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -61,6 +61,10 @@ package_extract(Device *dev, char *name) char *where; int i, fd, ret; + /* Check to make sure it's not already there */ + if (!vsystem("pkg_info -e %s")) + return RET_SUCCESS; + if (!dev->init(dev)) return RET_FAIL; @@ -90,7 +94,7 @@ package_extract(Device *dev, char *name) close(fd); tpid = waitpid(tpid, &pstat, 0); if (vsystem("(pwd; cat +CONTENTS) | pkg_add %s-S", - variable_get(CPIO_VERBOSITY_LEVEL), "high") ? "-v " : "") + !strcmp(variable_get(CPIO_VERBOSITY_LEVEL), "high") ? "-v " : "")) msgConfirm("An error occurred while trying to pkg_add %s.\n" "Please check debugging screen for possible further details.", path); else |