diff options
author | jkh <jkh@FreeBSD.org> | 1998-12-22 12:31:26 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1998-12-22 12:31:26 +0000 |
commit | e72da228343024d66a2d2be92429e6bfec4f6fa1 (patch) | |
tree | 705855b9e9773f3964f64d41928812ef61a6c9f4 /usr.sbin/sysinstall/media.c | |
parent | 91bd0e66beb40a53efaf61eaad295aaf08f1384f (diff) | |
download | FreeBSD-src-e72da228343024d66a2d2be92429e6bfec4f6fa1.zip FreeBSD-src-e72da228343024d66a2d2be92429e6bfec4f6fa1.tar.gz |
Collapse the "get" code substantially by combining common functions.
Also make mountpoint for each media type easier to change.
Also reshuffled some menus for easier usage.
Diffstat (limited to 'usr.sbin/sysinstall/media.c')
-rw-r--r-- | usr.sbin/sysinstall/media.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 05080d6..87f63f4 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.92 1998/11/02 10:42:18 obrien Exp $ + * $Id: media.c,v 1.93 1998/12/02 03:27:37 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -204,8 +204,6 @@ mediaSetFloppy(dialogMenuItem *self) } else mediaDevice = devs[0]; - if (mediaDevice) - mediaDevice->private = "/dist"; return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE; } @@ -764,3 +762,23 @@ mediaSetCPIOVerbosity(dialogMenuItem *self) } return DITEM_SUCCESS; } + +/* A generic open which follows a well-known "path" of places to look */ +FILE * +mediaGenericGet(char *base, const char *file) +{ + char buf[PATH_MAX]; + + snprintf(buf, PATH_MAX, "%s/%s", base, file); + if (file_readable(buf)) + return fopen(buf, "r"); + snprintf(buf, PATH_MAX, "%s/releases/%s", base, file); + if (file_readable(buf)) + return fopen(buf, "r"); + snprintf(buf, PATH_MAX, "%s/%s/%s", base, variable_get(VAR_RELNAME), file); + if (file_readable(buf)) + return fopen(buf, "r"); + snprintf(buf, PATH_MAX, "%s/releases/%s/%s", base, variable_get(VAR_RELNAME), file); + return fopen(buf, "r"); +} + |