aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/sysinstall/dist.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1997-06-05 09:48:03 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1997-06-05 09:48:03 +0000
commit8e45ec2c8c6bd1731dbd6e613bacf12784585b3d (patch)
tree47b6dc98be72af98ae313709708cc4a518725867 /usr.sbin/sysinstall/dist.c
parentd5740fac52aefd9b8687af9644da19b76515d4eb (diff)
downloadsrc-8e45ec2c8c6bd1731dbd6e613bacf12784585b3d.tar.gz
src-8e45ec2c8c6bd1731dbd6e613bacf12784585b3d.zip
Resurrect / implement some of the more esoteric scripting features,
such as partitioning a disk or overriding an interactive prompt.
Notes
Notes: svn path=/head/; revision=26456
Diffstat (limited to 'usr.sbin/sysinstall/dist.c')
-rw-r--r--usr.sbin/sysinstall/dist.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c
index 09f5a2935b7e..aeb81756f84a 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)
{