diff options
-rw-r--r-- | release/sysinstall/apache.c | 11 | ||||
-rw-r--r-- | release/sysinstall/package.c | 40 | ||||
-rw-r--r-- | usr.sbin/sysinstall/package.c | 40 |
3 files changed, 37 insertions, 54 deletions
diff --git a/release/sysinstall/apache.c b/release/sysinstall/apache.c index 965a3b4..f853766 100644 --- a/release/sysinstall/apache.c +++ b/release/sysinstall/apache.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.71.2.52 1995/10/22 17:39:12 jkh Exp $ + * $Id: apache.c,v 1.2 1995/10/22 21:38:04 jkh Exp $ * * Copyright (c) 1995 * Coranth Gryphon. All rights reserved. @@ -55,6 +55,7 @@ #define APACHE_BASE "/usr/local/www" #define APACHE_HELPFILE "apache.html" +#define APACHE_PACKAGE "apache-0.8.14" typedef struct { @@ -391,9 +392,11 @@ installApache(char *unused) char tbuf[128], company[64], file[128], cmd[256]; char *tptr; FILE *fptr; - - i = apacheOpenDialog(); - + + i = package_add(APACHE_PACKAGE); + if (i == RET_SUCCESS) + i = apacheOpenDialog(); + if (i != RET_SUCCESS) return (i); diff --git a/release/sysinstall/package.c b/release/sysinstall/package.c index a7c6af5..68776d7 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.13 1995/10/22 17:39:28 jkh Exp $ + * $Id: package.c,v 1.15 1995/10/22 21:38:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -87,27 +87,10 @@ package_extract(Device *dev, char *name) msgNotify("pkg_extract: Attempting to fetch %s\nfrom %s", path, dev->name); fd = dev->get(dev, path, TRUE); if (fd >= 0) { - pid_t tpid; - pen[0] = '\0'; if ((where = make_playpen(pen, 0)) != NULL) { - if (isDebug()) - msgDebug("Working in temporary directory %s, will return to %s\n", pen, where); - tpid = fork(); - if (!tpid) { - dup2(fd, 0); close(fd); - dup2(DebugFD, 1); - dup2(DebugFD, 2); - i = vsystem("tar %s-xpzf -", !strcmp(variable_get(VAR_CPIO_VERBOSITY), "high") ? "-v " : ""); - if (i) - msgDebug("tar command returns %d status (errno: %d)\n", i, errno); - exit(i); - } - else { - int pstat; - - tpid = waitpid(tpid, &pstat, 0); - if (!pstat && file_readable("+CONTENTS")) { + if (mediaExtractDist(pen, fd)) { + if (file_readable("+CONTENTS")) { if (vsystem("(pwd; cat +CONTENTS) | pkg_add %s-S", !strcmp(variable_get(VAR_CPIO_VERBOSITY), "high") ? "-v " : "")) { dialog_clear(); @@ -119,12 +102,19 @@ package_extract(Device *dev, char *name) } else { dialog_clear(); - msgConfirm("The package fetch and extraction phase failed for %s\n" - "and it will not be pkg_add'd. There was either a media\n" - "error of some sort or the package file itself is corrupted.\n" - "You may wish to look into this and try again."); + msgConfirm("The package specified (%s) has no CONTENTS file. This means\n" + "that there was either a media error of some sort or the package\n" + "file itself is corrupted.\n" + "You may wish to look into this and try again.", name); } - close(fd); + dev->close(dev, fd); + } + else { + ret = RET_FAIL; + msgConfirm("Unable to extract the contents of package %s. This means\n" + "that there was either a media error of some sort or the package\n" + "file itself is corrupted.\n" + "You may wish to look into this and try again.", name); } if (chdir(where) == -1) msgFatal("Unable to get back to where I was before, Jojo! (That was: %s)", where); diff --git a/usr.sbin/sysinstall/package.c b/usr.sbin/sysinstall/package.c index a7c6af5..68776d7 100644 --- a/usr.sbin/sysinstall/package.c +++ b/usr.sbin/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.13 1995/10/22 17:39:28 jkh Exp $ + * $Id: package.c,v 1.15 1995/10/22 21:38:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -87,27 +87,10 @@ package_extract(Device *dev, char *name) msgNotify("pkg_extract: Attempting to fetch %s\nfrom %s", path, dev->name); fd = dev->get(dev, path, TRUE); if (fd >= 0) { - pid_t tpid; - pen[0] = '\0'; if ((where = make_playpen(pen, 0)) != NULL) { - if (isDebug()) - msgDebug("Working in temporary directory %s, will return to %s\n", pen, where); - tpid = fork(); - if (!tpid) { - dup2(fd, 0); close(fd); - dup2(DebugFD, 1); - dup2(DebugFD, 2); - i = vsystem("tar %s-xpzf -", !strcmp(variable_get(VAR_CPIO_VERBOSITY), "high") ? "-v " : ""); - if (i) - msgDebug("tar command returns %d status (errno: %d)\n", i, errno); - exit(i); - } - else { - int pstat; - - tpid = waitpid(tpid, &pstat, 0); - if (!pstat && file_readable("+CONTENTS")) { + if (mediaExtractDist(pen, fd)) { + if (file_readable("+CONTENTS")) { if (vsystem("(pwd; cat +CONTENTS) | pkg_add %s-S", !strcmp(variable_get(VAR_CPIO_VERBOSITY), "high") ? "-v " : "")) { dialog_clear(); @@ -119,12 +102,19 @@ package_extract(Device *dev, char *name) } else { dialog_clear(); - msgConfirm("The package fetch and extraction phase failed for %s\n" - "and it will not be pkg_add'd. There was either a media\n" - "error of some sort or the package file itself is corrupted.\n" - "You may wish to look into this and try again."); + msgConfirm("The package specified (%s) has no CONTENTS file. This means\n" + "that there was either a media error of some sort or the package\n" + "file itself is corrupted.\n" + "You may wish to look into this and try again.", name); } - close(fd); + dev->close(dev, fd); + } + else { + ret = RET_FAIL; + msgConfirm("Unable to extract the contents of package %s. This means\n" + "that there was either a media error of some sort or the package\n" + "file itself is corrupted.\n" + "You may wish to look into this and try again.", name); } if (chdir(where) == -1) msgFatal("Unable to get back to where I was before, Jojo! (That was: %s)", where); |