summaryrefslogtreecommitdiffstats
path: root/release/sysinstall/package.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-10-22 23:20:45 +0000
committerjkh <jkh@FreeBSD.org>1995-10-22 23:20:45 +0000
commite4ec88fb50e7defa517d1bec640d36f17a902951 (patch)
treed04b6acdb5d6730011975f300e2ba2973b27a238 /release/sysinstall/package.c
parent8669027cdddcb83d69a6434426fec7c34f889867 (diff)
downloadFreeBSD-src-e4ec88fb50e7defa517d1bec640d36f17a902951.zip
FreeBSD-src-e4ec88fb50e7defa517d1bec640d36f17a902951.tar.gz
Don't use tar to add packages, use cpio in tar mode. Works better.
Make the apache setup try to load the package first..
Diffstat (limited to 'release/sysinstall/package.c')
-rw-r--r--release/sysinstall/package.c40
1 files changed, 15 insertions, 25 deletions
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);
OpenPOWER on IntegriCloud