summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/media.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-04-30 22:40:06 +0000
committerobrien <obrien@FreeBSD.org>2002-04-30 22:40:06 +0000
commit451e89b13e6de1a22c9029acdbe0565ca18f560b (patch)
tree04291a07fc7c8d7c5c9cdbcb74819128b46fc53c /usr.sbin/sysinstall/media.c
parent968fe15c4ddd29119f7160321c6530f8df1bd320 (diff)
downloadFreeBSD-src-451e89b13e6de1a22c9029acdbe0565ca18f560b.zip
FreeBSD-src-451e89b13e6de1a22c9029acdbe0565ca18f560b.tar.gz
Add the ability to use Bzip'ed packages.
Also add the ability to use Bzip'ed distributions -- but this is exclusive of being able to use Gzip'ed distributions. Sponsored by: FreeBSD Mall, Inc.
Diffstat (limited to 'usr.sbin/sysinstall/media.c')
-rw-r--r--usr.sbin/sysinstall/media.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c
index 7577aac..26e5f46 100644
--- a/usr.sbin/sysinstall/media.c
+++ b/usr.sbin/sysinstall/media.c
@@ -604,7 +604,8 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid)
pipe(qfd);
*zpid = fork();
if (!*zpid) {
- char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip";
+ char *unzipper = RunningAsInit ? "/stand/" UNZIPPER
+ : "/usr/bin/" UNZIPPER;
dup2(qfd[0], 0); close(qfd[0]);
dup2(pfd[1], 1); close(pfd[1]);
@@ -616,9 +617,9 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid)
}
close(qfd[1]);
close(pfd[0]);
- i = execl(gunzip, gunzip, (char *)0);
+ i = execl(unzipper, unzipper, (char *)0);
if (isDebug())
- msgDebug("%s command returns %d status\n", gunzip, i);
+ msgDebug("%s command returns %d status\n", unzipper, i);
exit(i);
}
*fd = qfd[1];
@@ -660,7 +661,8 @@ mediaExtractDistEnd(int zpid, int cpid)
/* Don't check exit status - gunzip seems to return a bogus one! */
if (i < 0) {
if (isDebug())
- msgDebug("wait for gunzip returned status of %d!\n", i);
+ msgDebug("wait for %s returned status of %d!\n",
+ USE_GZIP ? "gunzip" : "bunzip2", i);
return FALSE;
}
i = waitpid(cpid, &j, 0);
@@ -689,7 +691,8 @@ mediaExtractDist(char *dir, char *dist, FILE *fp)
pipe(qfd); /* write end */
zpid = fork();
if (!zpid) {
- char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip";
+ char *unzipper = RunningAsInit ? "/stand/" UNZIPPER
+ : "/usr/bin/" UNZIPPER;
fclose(fp);
close(qfd[1]);
@@ -704,9 +707,9 @@ mediaExtractDist(char *dir, char *dist, FILE *fp)
close(2);
open("/dev/null", O_WRONLY);
}
- i = execl(gunzip, gunzip, (char *)0);
+ i = execl(unzipper, unzipper, (char *)0);
if (isDebug())
- msgDebug("%s command returns %d status\n", gunzip, i);
+ msgDebug("%s command returns %d status\n", unzipper, i);
exit(i);
}
cpid = fork();
@@ -775,7 +778,8 @@ mediaExtractDist(char *dir, char *dist, FILE *fp)
/* Don't check exit status - gunzip seems to return a bogus one! */
if (i < 0) {
if (isDebug())
- msgDebug("wait for gunzip returned status of %d!\n", i);
+ msgDebug("wait for %s returned status of %d!\n",
+ USE_GZIP ? "gunzip" : "bunzip2", i);
return FALSE;
}
i = waitpid(cpid, &j, 0);
OpenPOWER on IntegriCloud