diff options
author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-05-15 14:38:44 +0000 |
---|---|---|
committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1999-05-15 14:38:44 +0000 |
commit | a21d905bae94bc358756957b1c26e2ec3f487e82 (patch) | |
tree | 43333ccf39907cce15a71339161c00a56d1d73d4 | |
parent | c2b6b86e48d5a4f403b99c3c9287a9b39189a778 (diff) |
Notes
-rw-r--r-- | release/sysinstall/cdrom.c | 65 | ||||
-rw-r--r-- | release/sysinstall/config.c | 5 | ||||
-rw-r--r-- | release/sysinstall/index.c | 52 | ||||
-rw-r--r-- | release/sysinstall/menus.c | 4 | ||||
-rw-r--r-- | release/sysinstall/package.c | 12 | ||||
-rw-r--r-- | release/sysinstall/sysinstall.h | 5 |
6 files changed, 75 insertions, 68 deletions
diff --git a/release/sysinstall/cdrom.c b/release/sysinstall/cdrom.c index 011520211dbf..decf297d77c9 100644 --- a/release/sysinstall/cdrom.c +++ b/release/sysinstall/cdrom.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: cdrom.c,v 1.44 1998/12/22 12:31:24 jkh Exp $ + * $Id: cdrom.c,v 1.45 1999/01/20 12:31:42 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -112,36 +112,57 @@ mediaInitCDROM(Device *dev) } } - if (readInfo && - (!(cd_attr = read_props(string_concat(mountpoint, "/cdrom.inf"))) || - !(cp = property_find(cd_attr, "CD_VERSION")) || (strcmp(cp, variable_get(VAR_RELNAME)) && strcmp("none", variable_get(VAR_RELNAME))))) { - if (!cp) { + if (readInfo) { + if (!(cd_attr = read_props(string_concat(mountpoint, "/cdrom.inf"))) + || !(cp = property_find(cd_attr, "CD_VERSION"))) { msgConfirm("Unable to find a %s/cdrom.inf file.\n" "Either this is not a FreeBSD CDROM, there is a problem with\n" "the CDROM driver or something is wrong with your hardware.\n" "Please fix this problem (check the console logs on VTY2) and\n" "try again.", mountpoint); } - else if (!bogusCDOK) { - msgConfirm("Warning: The version of the FreeBSD CD currently in the drive\n" - "(%s) does not match the version of the boot floppy\n" - "(%s).\n\n" - "If this is intentional, to avoid this message in the future\n" - "please visit the Options editor to set the boot floppy version\n" - "string to match that of the CD before selecting it as your\n" - "installation media.", cp, variable_get(VAR_RELNAME)); - - if (msgYesNo("Would you like to try and use this CDROM anyway?") != 0) { - unmount(mountpoint, MNT_FORCE); - cdromMounted = FALSE; - properties_free(cd_attr); - return FALSE; + else { + if (variable_cmp(VAR_RELNAME, cp) + && variable_cmp(VAR_RELNAME, "none") + && variable_cmp(VAR_RELNAME, "any") && !bogusCDOK) { + msgConfirm("Warning: The version of the FreeBSD CD currently in the drive\n" + "(%s) does not match the version of the boot floppy\n" + "(%s).\n\n" + "If this is intentional, to avoid this message in the future\n" + "please visit the Options editor to set the boot floppy version\n" + "string to match that of the CD before selecting it as your\n" + "installation media.", cp, variable_get(VAR_RELNAME)); + + if (msgYesNo("Would you like to try and use this CDROM anyway?") != 0) { + unmount(mountpoint, MNT_FORCE); + cdromMounted = FALSE; + properties_free(cd_attr); + return FALSE; + } + else + bogusCDOK = TRUE; + } + if ((cp = property_find(cd_attr, "CD_MACHINE_ARCH")) != NULL) { +#ifdef __alpha__ + if (strcmp(cp, "alpha")) { +#else + if (strcmp(cp, "x86")) { +#endif + msgConfirm("Fatal: The FreeBSD install CD currently in the drive\n" + "is for the %s architecture, not the machine you're using.\n\n" + + "Please use the correct installation CD for your machine type.", cp); + + unmount(mountpoint, MNT_FORCE); + cdromMounted = FALSE; + properties_free(cd_attr); + return FALSE; + } } - else - bogusCDOK = TRUE; } } - properties_free(cd_attr); + if (cd_attr) + properties_free(cd_attr); return TRUE; } diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index 8b37b013f1e4..97c81b14894a 100644 --- a/release/sysinstall/config.c +++ b/release/sysinstall/config.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.115.2.16 1999/05/12 09:32:51 jkh Exp $ + * $Id: config.c,v 1.115.2.17 1999/05/14 15:04:45 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -724,7 +724,8 @@ configPackages(dialogMenuItem *self) if (ret & DITEM_LEAVE_MENU) break; else if (DITEM_STATUS(ret) != DITEM_FAILURE) { - index_extract(mediaDevice, &Top, &Plist); + for (tmp = Plist.kids; tmp && tmp->name; tmp = tmp->next) + (void)index_extract(mediaDevice, &Top, tmp, FALSE); break; } } diff --git a/release/sysinstall/index.c b/release/sysinstall/index.c index 57000ae06635..3d9cdf6ee5c8 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.60.2.4 1999/05/12 09:04:12 jkh Exp $ + * $Id: index.c,v 1.60.2.5 1999/05/14 12:15:51 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -70,7 +70,7 @@ _strdup(char *ptr) static char *descrs[] = { "Package Selection", "To mark a package, move to it and press SPACE. If the package is\n" "already marked, it will be unmarked or deleted (if installed).\n" - "Items marked with a 'D' are dependencies which will be auto-loaded\n." + "Items marked with a `D' are dependencies which will be auto-loaded.\n" "To search for a package by name, press ESC. To select a category,\n" "press RETURN. NOTE: The All category selection creates a very large\n" "submenu! If you select it, please be patient while it comes up.", @@ -375,8 +375,7 @@ index_sort(PkgNodePtr top) } } - /* Now sub-sort everything n levels down */ - + /* Now sub-sort everything n levels down */ for (p = top->kids; p; p = p->next) { if (p->kids) index_sort(p); @@ -407,24 +406,23 @@ index_search(PkgNodePtr top, char *str, PkgNodePtr *tp) PkgNodePtr p, sp; for (p = top->kids; p && p->name; p = p->next) { - /* Subtract out the All category from searches */ - if (!strcmp(p->name, "All")) - continue; - - /* If tp == NULL, we're looking for an exact package match */ - if (!tp && !strcmp(p->name, str)) - return p; - - /* If tp, we're looking for both a package and a pointer to the place it's in */ - if (tp && !strncmp(p->name, str, strlen(str))) { - *tp = top; - return p; - } + if (p->type == PACKAGE) { + /* If tp == NULL, we're looking for an exact package match */ + if (!tp && !strcmp(p->name, str)) + return p; + + /* If tp, we're looking for both a package and a pointer to the place it's in */ + if (tp && !strncmp(p->name, str, strlen(str))) { + *tp = top; + return p; + } - /* The usual recursion-out-of-laziness ploy */ - if (p->kids) + } + else if (p->kids) { + /* The usual recursion-out-of-laziness ploy */ if ((sp = index_search(p, str, tp)) != NULL) return sp; + } } if (p && !p->name) p = NULL; @@ -621,19 +619,7 @@ recycle: } int -index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist) -{ - PkgNodePtr tmp; - int status = DITEM_SUCCESS; - - for (tmp = plist->kids; tmp && tmp->name; tmp = tmp->next) - if (DITEM_STATUS(index_extract_one(dev, top, tmp, FALSE)) != DITEM_SUCCESS) - status = DITEM_FAILURE; - return status | DITEM_RESTORE; -} - -int -index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended) +index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended) { int status = DITEM_SUCCESS; PkgNodePtr tmp2; @@ -648,7 +634,7 @@ index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended) if ((cp2 = index(cp, ' ')) != NULL) *cp2 = '\0'; if ((tmp2 = index_search(top, cp, NULL)) != NULL) { - status = index_extract_one(dev, top, tmp2, TRUE); + status = index_extract(dev, top, tmp2, TRUE); if (DITEM_STATUS(status) != DITEM_SUCCESS) { if (variable_get(VAR_NO_CONFIRM)) msgNotify("Loading of dependant package %s failed", cp); diff --git a/release/sysinstall/menus.c b/release/sysinstall/menus.c index 473391e440da..19807b04ec1d 100644 --- a/release/sysinstall/menus.c +++ b/release/sysinstall/menus.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: menus.c,v 1.180.2.21 1999/05/12 22:06:17 jkh Exp $ + * $Id: menus.c,v 1.180.2.22 1999/05/14 07:16:32 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -1191,7 +1191,7 @@ DMenu MenuConfigure = { NULL, optionsEditor }, { "X XFree86", "Configure XFree86 Server", NULL, configXSetup }, - { "X Desktop", "Configure XFree86 Desktop", + { "D Desktop", "Configure XFree86 Desktop", NULL, configXDesktop }, { "H HTML Docs", "Go to the HTML documentation menu (post-install)", NULL, docBrowser }, diff --git a/release/sysinstall/package.c b/release/sysinstall/package.c index 1c4c94a50a8f..d7f8588d939d 100644 --- a/release/sysinstall/package.c +++ b/release/sysinstall/package.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: package.c,v 1.65.2.6 1999/05/14 14:30:07 jkh Exp $ + * $Id: package.c,v 1.65.2.7 1999/05/14 14:58:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -63,10 +63,10 @@ package_add(char *name) i = index_initialize("packages/INDEX"); if (DITEM_STATUS(i) != DITEM_SUCCESS) return i; - tmp3 = !strpbrk(name, "-_") ? &tmp2 : NULL; + tmp3 = strpbrk(name, "-_") ? NULL : &tmp2; tmp = index_search(&Top, name, tmp3); if (tmp) - return index_extract_one(mediaDevice, &Top, tmp, FALSE); + return index_extract(mediaDevice, &Top, tmp, FALSE); else { msgConfirm("Sorry, package %s was not found in the INDEX.", name); return DITEM_FAILURE | DITEM_RESTORE; @@ -152,7 +152,9 @@ package_extract(Device *dev, char *name, Boolean depended) int i = 0, tot, pfd[2]; pid_t pid; + sigpipe_caught = FALSE; signal(SIGPIPE, catch_pipe); + msgNotify("Adding %s%s\nfrom %s", path, depended ? " (as a dependency)" : "", dev->name); pipe(pfd); pid = fork(); @@ -165,8 +167,6 @@ package_extract(Device *dev, char *name, Boolean depended) i = execl("/usr/sbin/pkg_add", "/usr/sbin/pkg_add", "-v", "-", 0); else i = execl("/usr/sbin/pkg_add", "/usr/sbin/pkg_add", "-", 0); - if (isDebug()) - msgDebug("pkg_add returns %d status\n", i); } else { char buf[BUFSIZ]; @@ -227,7 +227,6 @@ package_extract(Device *dev, char *name, Boolean depended) sleep(1); restorescr(w); - sigpipe_caught = FALSE; } } else { @@ -240,5 +239,6 @@ package_extract(Device *dev, char *name, Boolean depended) "No package add will be done.", name); ret = DITEM_FAILURE | DITEM_RESTORE; } + signal(SIGPIPE, SIG_IGN); return ret; } diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index 4378af3b1457..fbaa7f4dac84 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -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: sysinstall.h,v 1.153.2.10 1999/05/07 11:03:23 jkh Exp $ + * $Id: sysinstall.h,v 1.153.2.11 1999/05/12 09:04:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -528,8 +528,7 @@ void index_init(PkgNodePtr top, PkgNodePtr plist); void index_node_free(PkgNodePtr top, PkgNodePtr plist); void index_sort(PkgNodePtr top); void index_print(PkgNodePtr top, int level); -int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist); -int index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended); +int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended); int index_initialize(char *path); PkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp); |