diff options
author | jkh <jkh@FreeBSD.org> | 1998-07-18 09:42:02 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1998-07-18 09:42:02 +0000 |
commit | c1d10d181de9930858213c26964bf148cbe069b5 (patch) | |
tree | bfa3f95ddcd21759181a743fd429f5a33e0d0ad1 /usr.sbin/sade/dispatch.c | |
parent | 7466f92c1a75cdfc614e9b0f5eccf1f8afb31d06 (diff) | |
download | FreeBSD-src-c1d10d181de9930858213c26964bf148cbe069b5.zip FreeBSD-src-c1d10d181de9930858213c26964bf148cbe069b5.tar.gz |
MF22: Paul Traina's changes.
Diffstat (limited to 'usr.sbin/sade/dispatch.c')
-rw-r--r-- | usr.sbin/sade/dispatch.c | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/usr.sbin/sade/dispatch.c b/usr.sbin/sade/dispatch.c index 67e09d6..9bac849 100644 --- a/usr.sbin/sade/dispatch.c +++ b/usr.sbin/sade/dispatch.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dispatch.c,v 1.23 1997/09/16 18:57:08 jkh Exp $ + * $Id: dispatch.c,v 1.24 1997/09/17 16:18:13 pst Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -44,6 +44,7 @@ static int dispatch_shutdown(dialogMenuItem *unused); static int dispatch_systemExecute(dialogMenuItem *unused); +static int dispatch_msgConfirm(dialogMenuItem *unused); static struct _word { char *name; @@ -88,6 +89,7 @@ static struct _word { { "installFilesystems", installFilesystems }, { "installVarDefaults", installVarDefaults }, { "loadConfig", dispatch_load_file }, + { "loadFloppyConfig", dispatch_load_floppy }, { "mediaSetCDROM", mediaSetCDROM }, { "mediaSetFloppy", mediaSetFloppy }, { "mediaSetDOS", mediaSetDOS }, @@ -100,6 +102,7 @@ static struct _word { { "mediaSetFTPUserPass", mediaSetFTPUserPass }, { "mediaSetCPIOVerbosity", mediaSetCPIOVerbosity }, { "mediaGetType", mediaGetType }, + { "msgConfirm", dispatch_msgConfirm }, { "optionsEditor", optionsEditor }, { "register", configRegister }, /* Alias */ { "packageAdd", packageAdd }, @@ -107,6 +110,8 @@ static struct _word { { "addUser", userAddUser }, { "shutdown", dispatch_shutdown }, { "system", dispatch_systemExecute }, + { "dumpVariables", dump_variables }, + { "tcpMenuSelect", tcpMenuSelect }, { NULL, NULL }, }; @@ -183,6 +188,20 @@ dispatch_systemExecute(dialogMenuItem *unused) } static int +dispatch_msgConfirm(dialogMenuItem *unused) +{ + char *msg = variable_get(VAR_COMMAND); + + if (msg) { + msgConfirm(msg); + return DITEM_SUCCESS; + } + + msgDebug("_msgConfirm: No message passed in `command' variable.\n"); + return DITEM_FAILURE; +} + +static int call_possible_resword(char *name, dialogMenuItem *value, int *status) { int i, rval; @@ -272,12 +291,17 @@ dispatch_execute(qelement *head) { int result = DITEM_SUCCESS; command_buffer *item; + char *old_interactive; if (!head) return result | DITEM_FAILURE; + old_interactive = variable_get(VAR_NONINTERACTIVE); + if (old_interactive) + old_interactive = strdup(old_interactive); /* save copy */ + /* Hint to others that we're running from a script, should they care */ - variable_set2(VAR_NONINTERACTIVE, "YES"); + variable_set2(VAR_NONINTERACTIVE, "yes"); while (!EMPTYQUE(*head)) { item = (command_buffer *) head->q_forw; @@ -301,7 +325,12 @@ dispatch_execute(qelement *head) dispatch_free_all(head); - variable_unset(VAR_NONINTERACTIVE); + if (!old_interactive) + variable_unset(VAR_NONINTERACTIVE); + else { + variable_set2(VAR_NONINTERACTIVE, old_interactive); + free(old_interactive); + } return result; } @@ -394,7 +423,8 @@ dispatch_load_floppy(dialogMenuItem *self) what |= dispatch_execute(list); } else { - msgConfirm("Configuration file '%s' not found.", cp); + if (!variable_get(VAR_NO_ERROR)) + msgConfirm("Configuration file '%s' not found.", cp); variable_unset(VAR_INSTALL_CFG); what |= DITEM_FAILURE; mediaClose(); |