diff options
author | jkh <jkh@FreeBSD.org> | 1997-06-05 09:48:03 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-06-05 09:48:03 +0000 |
commit | 9160ca00b5da185787c84ae5e1b1d848847dd262 (patch) | |
tree | 3707fb988b7a0ae5cc4e493af9c486da9892a1dd /usr.sbin/sysinstall/dist.c | |
parent | 4caf82f971a9e9d7368fa7667e4e43f98857e620 (diff) | |
download | FreeBSD-src-9160ca00b5da185787c84ae5e1b1d848847dd262.zip FreeBSD-src-9160ca00b5da185787c84ae5e1b1d848847dd262.tar.gz |
Resurrect / implement some of the more esoteric scripting features,
such as partitioning a disk or overriding an interactive prompt.
Diffstat (limited to 'usr.sbin/sysinstall/dist.c')
-rw-r--r-- | usr.sbin/sysinstall/dist.c | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index 09f5a29..aeb8175 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dist.c,v 1.106 1997/04/20 16:46:28 jkh Exp $ + * $Id: dist.c,v 1.107 1997/05/05 05:16:01 pst Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -380,6 +380,56 @@ distMaybeSetPorts(dialogMenuItem *self) return DITEM_SUCCESS | DITEM_RESTORE; } +static Boolean +distSetByName(Distribution *dist, char *name) +{ + int i, status = FALSE; + + /* Loop through current set */ + for (i = 0; dist[i].my_name; i++) { + /* This is shorthand for "dist currently disabled" */ + if (!dist[i].my_dir) + continue; + else if (!strcmp(dist[i].my_name, name)) { + *(dist[i].my_mask) &= ~(dist[i].my_bit); + status = TRUE; + break; + } + else if (dist[i].my_dist) { + if (distSetByName(dist[i].my_dist, name)) { + status = TRUE; + break; + } + } + } + return status; +} + +/* Just for the dispatch stuff */ +int +distSetCustom(dialogMenuItem *self) +{ + char *cp, *cp2, *tmp; + + if (!(tmp = variable_get(VAR_DISTS))) { + msgDebug("distSetCustom() called without %s variable set.\n", VAR_DISTS); + return DITEM_FAILURE; + } + + cp = alloca(strlen(tmp) + 1); + if (!cp) + msgFatal("Couldn't alloca() %d bytes!\n", strlen(tmp) + 1); + strcpy(cp, tmp); + while (cp) { + if ((cp2 = index(cp, ' ')) != NULL) + *(cp2++) = '\0'; + if (!distSetByName(DistTable, cp)) + msgDebug("distSetCustom: Warning, no such release \"%s\"\n", cp); + cp = cp2; + } + return DITEM_SUCCESS; +} + int distSetSrc(dialogMenuItem *self) { |