summaryrefslogtreecommitdiffstats
path: root/release/sysinstall/index.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-06-08 07:02:21 +0000
committerjkh <jkh@FreeBSD.org>1996-06-08 07:02:21 +0000
commit2a03e988da43e97ce7ad936d8d66606c4db8e434 (patch)
tree9d5e42a609d74826c3430900e01edf845acf1643 /release/sysinstall/index.c
parentf26a3ce6a2a8fbc774d07ae08e9f77d87500f70f (diff)
downloadFreeBSD-src-2a03e988da43e97ce7ad936d8d66606c4db8e434.zip
FreeBSD-src-2a03e988da43e97ce7ad936d8d66606c4db8e434.tar.gz
Make CDROMs automagically select as the default media type.
If you're running multi-user, check off items in the packages menu based on whether or not they're actually installed.
Diffstat (limited to 'release/sysinstall/index.c')
-rw-r--r--release/sysinstall/index.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/release/sysinstall/index.c b/release/sysinstall/index.c
index af5214f..d08f98b 100644
--- a/release/sysinstall/index.c
+++ b/release/sysinstall/index.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: index.c,v 1.29 1996/05/16 11:47:29 jkh Exp $
+ * $Id: index.c,v 1.30 1996/05/23 16:34:27 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -384,8 +384,15 @@ pkg_checked(dialogMenuItem *self)
{
PkgNodePtr kp = self->data, plist = (PkgNodePtr)self->aux;
- if (kp->type == PACKAGE && plist)
- return index_search(plist, kp->name, NULL) ? TRUE : FALSE;
+ if (kp->type == PACKAGE && kp->name && plist) {
+ int i;
+
+ i = index_search(plist, kp->name, NULL) ? TRUE : FALSE;
+ if (!RunningAsInit)
+ return i || package_exists(kp->name);
+ else
+ return i;
+ }
else
return FALSE;
}
@@ -402,14 +409,16 @@ pkg_fire(dialogMenuItem *self)
sp = index_search(plist, kp->name, NULL);
/* Not already selected? */
if (!sp) {
- PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode));
+ if (RunningAsInit || !package_exists(kp->name)) {
+ PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode));
- *np = *kp;
- np->next = plist->kids;
- plist->kids = np;
- msgInfo("Added %s to selection list", kp->name);
+ *np = *kp;
+ np->next = plist->kids;
+ plist->kids = np;
+ msgInfo("Added %s to selection list", kp->name);
+ }
}
- else if (sp) {
+ else {
msgInfo("Removed %s from selection list", kp->name);
index_delete(sp);
}
OpenPOWER on IntegriCloud