diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1997-01-15 16:21:10 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1997-01-15 16:21:10 +0000 |
| commit | d42e16a0d6512778cfae3ab11472b161d5074795 (patch) | |
| tree | 5cd14f8429c545bf05b57d3db39aae1b37ae9270 /usr.sbin/sysinstall | |
| parent | c5e12995c694a4ecf771a80ae2a119261a695f5c (diff) | |
Notes
Diffstat (limited to 'usr.sbin/sysinstall')
| -rw-r--r-- | usr.sbin/sysinstall/devices.c | 17 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/ftp.c | 5 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/install.c | 12 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/sysinstall.h | 1 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/tcpip.c | 2 |
5 files changed, 30 insertions, 7 deletions
diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index 5dcca807ac93..9580cdb2a61f 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/sysinstall/devices.c @@ -358,6 +358,23 @@ deviceFind(char *name, DeviceType class) return j ? found : NULL; } +Device ** +deviceFindDescr(char *name, char *desc, DeviceType class) +{ + static Device *found[DEV_MAX]; + int i, j; + + j = 0; + for (i = 0; i < numDevs; i++) { + if ((!name || !strcmp(Devices[i]->name, name)) && + (!desc || !strcmp(Devices[i]->description, desc)) && + (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) + found[j++] = Devices[i]; + } + found[j] = NULL; + return j ? found : NULL; +} + int deviceCount(Device **devs) { diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c index f1e43043a64a..1c5a6e613a38 100644 --- a/usr.sbin/sysinstall/ftp.c +++ b/usr.sbin/sysinstall/ftp.c @@ -103,9 +103,10 @@ try: if (dir && *dir != '\0') { if ((i = ftpChdir(OpenConn, dir)) != 0) { if (i == 550) - msgConfirm("No such directory %s, please check your path and try again.", dir); + msgConfirm("No such directory ftp://%s/%s\n" + "please check your URL and try again.", hostname, dir); else - msgConfirm("FTP chdir to directory %s returned FTP error status %d\n", dir, i); + msgConfirm("FTP chdir to ftp://%s/%s returned error status %d\n", hostname, dir, i); goto punt; } } diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index af9d364fcf55..bf7e84a4b041 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -674,10 +674,14 @@ installCommit(dialogMenuItem *self) return DITEM_FAILURE | DITEM_RESTORE; } - if (!mediaDevice && !msgYesNo("You need to select a media type first. Do you want\n" - "to do this now?")) { - if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RESTORE; + if (!mediaDevice) { + if (!msgYesNo("You need to select a media type first. Do you want\n" + "to do this now?")) { + if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) + return DITEM_FAILURE | DITEM_RECREATE; + } + else + return DITEM_FAILURE | DITEM_RESTORE; } if (!mediaDevice->init(mediaDevice)) { diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 199ce9c4c868..c429beb15985 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -415,6 +415,7 @@ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogM int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern Device **deviceFind(char *name, DeviceType type); +extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index e807002b9258..6dfe32ca5b55 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -315,7 +315,7 @@ netHook(dialogMenuItem *self) { Device **devs; - devs = deviceFind(self->prompt, DEVICE_TYPE_NETWORK); + devs = deviceFindDescr(self->prompt, self->title, DEVICE_TYPE_NETWORK); if (devs) { if (DITEM_STATUS(tcpOpenDialog(devs[0])) != DITEM_FAILURE) mediaDevice = devs[0]; |
