diff options
author | jkh <jkh@FreeBSD.org> | 1996-04-07 03:52:36 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-04-07 03:52:36 +0000 |
commit | 61af07d0231e53139c2d8c49081a0f43da46af74 (patch) | |
tree | a289c0714788a15dfb0bcf3c9030a3425c5072c3 /usr.sbin/sysinstall/media.c | |
parent | 318997a39fbec1e8347a1ff0431ca2713799510f (diff) | |
download | FreeBSD-src-61af07d0231e53139c2d8c49081a0f43da46af74.zip FreeBSD-src-61af07d0231e53139c2d8c49081a0f43da46af74.tar.gz |
Major surgery.
1. Use new dialog menu hacks (no strings, just arrays of dialogMenuItem structs)
so that I can create composite menus with radio/checkbox/... items in them,
removing some long-standing UI bogons in various menus. This work isn't
finished yet, but will be done in two phases. This is phase one.
2. Remove all the script installation stuff. I never got time to document it,
it was arcane and it just complicated much of the code. There are better
ways of doing this if I want to do auto-driven installations later.
3. Remove much dead code and otherwise attempt to remove as much historical
grot as possible so that this code is easier to hack on. This is also
a two-stage process, phase one of which is now complete.
Diffstat (limited to 'usr.sbin/sysinstall/media.c')
-rw-r--r-- | usr.sbin/sysinstall/media.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 9543c12..89bea6e 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: media.c,v 1.29 1996/03/19 12:02:20 jkh Exp $ + * $Id: media.c,v 1.30 1996/03/21 17:20:31 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -87,7 +87,7 @@ cpioVerbosity() * be a CD. */ int -mediaSetCDROM(char *str) +mediaSetCDROM(dialogMenuItem *self) { Device **devs; int cnt; @@ -130,7 +130,7 @@ floppyHook(char *str) * be a floppy */ int -mediaSetFloppy(char *str) +mediaSetFloppy(dialogMenuItem *self) { Device **devs; int cnt; @@ -172,7 +172,7 @@ DOSHook(char *str) * be a DOS partition. */ int -mediaSetDOS(char *str) +mediaSetDOS(dialogMenuItem *self) { Device **devs; int cnt; @@ -212,7 +212,7 @@ tapeHook(char *str) * be a tape drive. */ int -mediaSetTape(char *str) +mediaSetTape(dialogMenuItem *self) { Device **devs; int cnt; @@ -261,12 +261,12 @@ mediaSetTape(char *str) * be an ftp server */ int -mediaSetFTP(char *str) +mediaSetFTP(dialogMenuItem *self) { static Device ftpDevice; char *cp; - if (!(str && !strcmp(str, "script") && (cp = variable_get(VAR_FTP_PATH)))) { + if (!(cp = variable_get(VAR_FTP_PATH))) { if (!dmenuOpenSimple(&MenuMediaFTP)) return RET_FAIL; else @@ -296,8 +296,7 @@ mediaSetFTP(char *str) } strcpy(ftpDevice.name, cp); - /* If str == NULL || "script", we were called just to change FTP sites, not network devices */ - if (str && strcmp(str, "script") && !tcpDeviceSelect()) + if (!tcpDeviceSelect()) return RET_FAIL; ftpDevice.type = DEVICE_TYPE_FTP; @@ -311,26 +310,26 @@ mediaSetFTP(char *str) } int -mediaSetFTPActive(char *str) +mediaSetFTPActive(dialogMenuItem *self) { variable_set2(VAR_FTP_STATE, "active"); - return mediaSetFTP(str); + return mediaSetFTP(self); } int -mediaSetFTPPassive(char *str) +mediaSetFTPPassive(dialogMenuItem *self) { variable_set2(VAR_FTP_STATE, "passive"); - return mediaSetFTP(str); + return mediaSetFTP(self); } int -mediaSetUFS(char *str) +mediaSetUFS(dialogMenuItem *self) { static Device ufsDevice; char *val; - if (!(str && !strcmp(str, "script") && (val = variable_get(VAR_UFS_PATH)))) { + if (!(val = variable_get(VAR_UFS_PATH))) { val = variable_get_value(VAR_UFS_PATH, "Enter a fully qualified pathname for the directory\n" "containing the FreeBSD distribution files:"); if (!val) @@ -348,21 +347,19 @@ mediaSetUFS(char *str) } int -mediaSetNFS(char *str) +mediaSetNFS(dialogMenuItem *self) { static Device nfsDevice; char *cp; - if (!(str && !strcmp(str, "script") && (cp = variable_get(VAR_NFS_PATH)))) { - cp = variable_get_value(VAR_NFS_PATH, "Please enter the full NFS file specification for the remote\n" - "host and directory containing the FreeBSD distribution files.\n" - "This should be in the format: hostname:/some/freebsd/dir"); - if (!cp) - return RET_FAIL; - } + cp = variable_get_value(VAR_NFS_PATH, "Please enter the full NFS file specification for the remote\n" + "host and directory containing the FreeBSD distribution files.\n" + "This should be in the format: hostname:/some/freebsd/dir"); + if (!cp) + return RET_FAIL; strncpy(nfsDevice.name, cp, DEV_NAME_MAX); /* str == NULL means we were just called to change NFS paths, not network interfaces */ - if (str && strcmp(str, "script") && !tcpDeviceSelect()) + if (!tcpDeviceSelect()) return RET_FAIL; nfsDevice.type = DEVICE_TYPE_NFS; nfsDevice.init = mediaInitNFS; @@ -519,7 +516,7 @@ mediaExtractDist(char *dir, int fd) } int -mediaGetType(char *unused) +mediaGetType(dialogMenuItem *self) { if (!dmenuOpenSimple(&MenuMedia)) return RET_FAIL; @@ -541,7 +538,7 @@ mediaVerify(void) /* Set FTP error behavior */ int -mediaSetFtpOnError(char *str) +mediaSetFtpOnError(dialogMenuItem *self) { char *cp = variable_get(VAR_FTP_ONERROR); @@ -563,7 +560,7 @@ mediaSetFtpOnError(char *str) /* Set the FTP username and password fields */ int -mediaSetFtpUserPass(char *str) +mediaSetFtpUserPass(dialogMenuItem *self) { char *pass; @@ -578,7 +575,7 @@ mediaSetFtpUserPass(char *str) /* Set CPIO verbosity level */ int -mediaSetCPIOVerbosity(char *str) +mediaSetCPIOVerbosity(dialogMenuItem *self) { char *cp = variable_get(VAR_CPIO_VERBOSITY); |