Almost snapshot time..

Merge today's work.

Now support an attributes file loaded at startup (true front-loaded install).
Add fuller debugging support to all device I/O routines.
Lots-o-bug fixes.
This commit is contained in:
Jordan K. Hubbard 1995-10-18 00:12:55 +00:00
parent 2e80ea0536
commit 3b9d53b13a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11553
4 changed files with 60 additions and 48 deletions

View File

@ -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.10 1995/10/16 23:02:28 jkh Exp $
* $Id: options.c,v 1.11 1995/10/17 02:57:01 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -63,19 +63,11 @@ varCheck(Option opt)
return NULL;
}
/* Nuke all the flags */
static int
resetFlags(char *str)
{
OptFlags = OPT_DEFAULT_FLAGS;
return 0;
}
/* Show our little logo */
static char *
resetLogo(char *str)
{
return "[whap!]";
return "[WHAP!]";
}
static Option Options[] = {
@ -83,7 +75,7 @@ static Option Options[] = {
OPT_IS_FLAG, &OptFlags, (void *)OPT_NFS_SECURE, NULL },
{ "NFS Slow", "User is using a slow PC or ethernet card",
OPT_IS_FLAG, &OptFlags, (void *)OPT_SLOW_ETHER, NULL },
{ "Debugging", "Emit extra debugging output on VTY1 (ALT-F2)",
{ "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)",
OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, NULL },
{ "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs",
OPT_IS_FLAG, &OptFlags, (void *)OPT_NO_CONFIRM, NULL },
@ -94,17 +86,19 @@ static Option Options[] = {
{ "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_FUNC, mediaSetTapeBlocksize, TAPE_BLOCKSIZE, varCheck },
{ "Detail Level", "How to display filenames on debug screen as CPIO extracts them",
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",
OPT_IS_FUNC, installSelectRelease, RELNAME, varCheck },
OPT_IS_VAR, "Please specify the release you wish to load", RELNAME, varCheck },
{ "Browser Pkg", "This is the browser package that will be used for viewing HTML",
OPT_IS_FUNC, docSelectBrowserPkg, BROWSER_PACKAGE, varCheck },
OPT_IS_VAR, "Please specify the name of the HTML browser package:", BROWSER_PACKAGE, varCheck },
{ "Browser Exec", "This is the path to the main binary of the browser package",
OPT_IS_FUNC, docSelectBrowserBin, BROWSER_BINARY, varCheck },
OPT_IS_VAR, "Please specify a full pathname to the HTML browser binary:", BROWSER_BINARY, varCheck },
{ "Config File", "Name of default configuration file for Load command (top menu)",
OPT_IS_VAR, "Please specify the name of a configuration file", CONFIG_FILE, varCheck },
{ "Reset Flags", "Reset all flag values to defaults",
OPT_IS_FUNC, resetFlags, 0, resetLogo },
OPT_IS_FUNC, installVarDefaults, 0, resetLogo },
{ NULL },
};
@ -137,6 +131,7 @@ value_of(Option opt)
return (*(int *)opt.data) & (int)opt.aux ? "ON" : "OFF";
case OPT_IS_FUNC:
case OPT_IS_VAR:
if (opt.check)
return opt.check(opt);
else
@ -160,6 +155,11 @@ fire(Option opt)
cp(NULL);
}
else if (opt.type == OPT_IS_VAR) {
dialog_clear();
(void)variable_get_value(opt.aux, opt.data);
dialog_clear();
}
if (opt.check)
opt.check(opt);
}
@ -193,7 +193,9 @@ optionsEditor(char *str)
/* Names are painted somewhat gratuitously each time, but it's easier this way */
mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name);
if (currOpt == i) standout();
attron(A_UNDERLINE);
mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i]));
attroff(A_UNDERLINE);
if (currOpt == i) standend();
if (optrow == OPT_END_ROW) {
optrow = OPT_START_ROW;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: package.c,v 1.1 1995/10/15 12:41:05 jkh Exp $
* $Id: package.c,v 1.2 1995/10/16 15:14:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -62,20 +62,22 @@ package_extract(Device *dev, char *name)
int i, fd, ret;
/* Check to make sure it's not already there */
if (!vsystem("pkg_info -e %s"))
if (!vsystem("pkg_info -e %s", name))
return RET_SUCCESS;
if (!dev->init(dev))
if (!dev->init(dev)) {
msgConfirm("Unable to initialize media type for package add.");
return RET_FAIL;
}
ret = RET_FAIL;
sprintf(path, "packages/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
fd = dev->get(dev, path, NULL);
sprintf(path, "packages/All/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
msgDebug("pkg_extract: Attempting to fetch %s\n", path);
fd = dev->get(dev, path, TRUE);
if (fd >= 0) {
pid_t tpid;
if (isDebug())
msgDebug("Got target %s from media type %d\n", path, dev->type);
msgNotify("Fetching %s from %s\n", path, dev->name);
pen[0] = '\0';
if ((where = make_playpen(pen, 0)) != NULL) {
if (isDebug())
@ -114,6 +116,8 @@ package_extract(Device *dev, char *name)
if (dev->type == DEVICE_TYPE_TAPE)
unlink(path);
}
else
msgDebug("pkg_extract: get operation returned %d\n", fd);
return ret;
}

View File

@ -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.10 1995/10/16 23:02:28 jkh Exp $
* $Id: options.c,v 1.11 1995/10/17 02:57:01 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -63,19 +63,11 @@ varCheck(Option opt)
return NULL;
}
/* Nuke all the flags */
static int
resetFlags(char *str)
{
OptFlags = OPT_DEFAULT_FLAGS;
return 0;
}
/* Show our little logo */
static char *
resetLogo(char *str)
{
return "[whap!]";
return "[WHAP!]";
}
static Option Options[] = {
@ -83,7 +75,7 @@ static Option Options[] = {
OPT_IS_FLAG, &OptFlags, (void *)OPT_NFS_SECURE, NULL },
{ "NFS Slow", "User is using a slow PC or ethernet card",
OPT_IS_FLAG, &OptFlags, (void *)OPT_SLOW_ETHER, NULL },
{ "Debugging", "Emit extra debugging output on VTY1 (ALT-F2)",
{ "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)",
OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, NULL },
{ "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs",
OPT_IS_FLAG, &OptFlags, (void *)OPT_NO_CONFIRM, NULL },
@ -94,17 +86,19 @@ static Option Options[] = {
{ "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_FUNC, mediaSetTapeBlocksize, TAPE_BLOCKSIZE, varCheck },
{ "Detail Level", "How to display filenames on debug screen as CPIO extracts them",
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",
OPT_IS_FUNC, installSelectRelease, RELNAME, varCheck },
OPT_IS_VAR, "Please specify the release you wish to load", RELNAME, varCheck },
{ "Browser Pkg", "This is the browser package that will be used for viewing HTML",
OPT_IS_FUNC, docSelectBrowserPkg, BROWSER_PACKAGE, varCheck },
OPT_IS_VAR, "Please specify the name of the HTML browser package:", BROWSER_PACKAGE, varCheck },
{ "Browser Exec", "This is the path to the main binary of the browser package",
OPT_IS_FUNC, docSelectBrowserBin, BROWSER_BINARY, varCheck },
OPT_IS_VAR, "Please specify a full pathname to the HTML browser binary:", BROWSER_BINARY, varCheck },
{ "Config File", "Name of default configuration file for Load command (top menu)",
OPT_IS_VAR, "Please specify the name of a configuration file", CONFIG_FILE, varCheck },
{ "Reset Flags", "Reset all flag values to defaults",
OPT_IS_FUNC, resetFlags, 0, resetLogo },
OPT_IS_FUNC, installVarDefaults, 0, resetLogo },
{ NULL },
};
@ -137,6 +131,7 @@ value_of(Option opt)
return (*(int *)opt.data) & (int)opt.aux ? "ON" : "OFF";
case OPT_IS_FUNC:
case OPT_IS_VAR:
if (opt.check)
return opt.check(opt);
else
@ -160,6 +155,11 @@ fire(Option opt)
cp(NULL);
}
else if (opt.type == OPT_IS_VAR) {
dialog_clear();
(void)variable_get_value(opt.aux, opt.data);
dialog_clear();
}
if (opt.check)
opt.check(opt);
}
@ -193,7 +193,9 @@ optionsEditor(char *str)
/* Names are painted somewhat gratuitously each time, but it's easier this way */
mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name);
if (currOpt == i) standout();
attron(A_UNDERLINE);
mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i]));
attroff(A_UNDERLINE);
if (currOpt == i) standend();
if (optrow == OPT_END_ROW) {
optrow = OPT_START_ROW;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: package.c,v 1.1 1995/10/15 12:41:05 jkh Exp $
* $Id: package.c,v 1.2 1995/10/16 15:14:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -62,20 +62,22 @@ package_extract(Device *dev, char *name)
int i, fd, ret;
/* Check to make sure it's not already there */
if (!vsystem("pkg_info -e %s"))
if (!vsystem("pkg_info -e %s", name))
return RET_SUCCESS;
if (!dev->init(dev))
if (!dev->init(dev)) {
msgConfirm("Unable to initialize media type for package add.");
return RET_FAIL;
}
ret = RET_FAIL;
sprintf(path, "packages/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
fd = dev->get(dev, path, NULL);
sprintf(path, "packages/All/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
msgDebug("pkg_extract: Attempting to fetch %s\n", path);
fd = dev->get(dev, path, TRUE);
if (fd >= 0) {
pid_t tpid;
if (isDebug())
msgDebug("Got target %s from media type %d\n", path, dev->type);
msgNotify("Fetching %s from %s\n", path, dev->name);
pen[0] = '\0';
if ((where = make_playpen(pen, 0)) != NULL) {
if (isDebug())
@ -114,6 +116,8 @@ package_extract(Device *dev, char *name)
if (dev->type == DEVICE_TYPE_TAPE)
unlink(path);
}
else
msgDebug("pkg_extract: get operation returned %d\n", fd);
return ret;
}