[BusyBox-cvs] svn commit: branches/busybox_1_00_stable/busybox/archival
landley at busybox.net
landley at busybox.net
Fri Aug 26 03:27:46 UTC 2005
Author: landley
Date: 2005-08-25 21:27:45 -0600 (Thu, 25 Aug 2005)
New Revision: 11255
Log:
Dirk Clemens made tar cj work while upgrading the Siemens M740AV to
busybox 1.01.
Modified:
branches/busybox_1_00_stable/busybox/archival/tar.c
Changeset:
Modified: branches/busybox_1_00_stable/busybox/archival/tar.c
===================================================================
--- branches/busybox_1_00_stable/busybox/archival/tar.c 2005-08-26 00:53:46 UTC (rev 11254)
+++ branches/busybox_1_00_stable/busybox/archival/tar.c 2005-08-26 03:27:45 UTC (rev 11255)
@@ -479,7 +479,10 @@
close(gzipStatusPipe[0]);
fcntl(gzipStatusPipe[1], F_SETFD, FD_CLOEXEC); /* close on exec shows sucess */
- execl("/bin/gzip", "gzip", "-f", 0);
+ if (gzip == 1)
+ execlp("gzip", "gzip", "-f", 0);
+ else
+ execlp("bzip2", "bzip2", "-f", 0);
vfork_exec_errno = errno;
close(gzipStatusPipe[1]);
@@ -538,7 +541,7 @@
freeHardLinkInfo(&tbInfo.hlInfoHead);
#ifdef CONFIG_FEATURE_TAR_GZIP
- if (gzip && gzipPid) {
+ if (gzipPid) {
if (waitpid(gzipPid, NULL, 0) == -1)
printf("Couldnt wait ?");
}
@@ -846,16 +849,16 @@
/* create an archive */
if (opt & CTX_CREATE) {
int verboseFlag = FALSE;
- int gzipFlag = FALSE;
+ int zipMode = 0;
# ifdef CONFIG_FEATURE_TAR_GZIP
if (get_header_ptr == get_header_tar_gz) {
- gzipFlag = TRUE;
+ zipMode = 1;
}
# endif /* CONFIG_FEATURE_TAR_GZIP */
# ifdef CONFIG_FEATURE_TAR_BZIP2
if (get_header_ptr == get_header_tar_bz2) {
- bb_error_msg_and_die("Creating bzip2 compressed archives is not currently supported.");
+ zipMode = 2;
}
# endif /* CONFIG_FEATURE_TAR_BZIP2 */
@@ -864,7 +867,7 @@
verboseFlag = TRUE;
}
writeTarFile(tar_handle->src_fd, verboseFlag, opt & TAR_OPT_DEREFERNCE, tar_handle->accept,
- tar_handle->reject, gzipFlag);
+ tar_handle->reject, zipMode);
} else
#endif /* CONFIG_FEATURE_TAR_CREATE */
{
More information about the busybox-cvs
mailing list