summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-03-15 02:41:44 +0000
committerkientzle <kientzle@FreeBSD.org>2008-03-15 02:41:44 +0000
commit4d2ae215121bada35b15ca47dc708a62262b9796 (patch)
tree481248cf49984da7a1f67451b0c59657ce507515 /usr.bin/tar
parent4c7ea30e332c5b1b372f1edd859f7ecb0aeee1a5 (diff)
downloadFreeBSD-src-4d2ae215121bada35b15ca47dc708a62262b9796.zip
FreeBSD-src-4d2ae215121bada35b15ca47dc708a62262b9796.tar.gz
Enable and document the -Z option for selecting "compress" compression,
now that libarchive supports it.
Diffstat (limited to 'usr.bin/tar')
-rw-r--r--usr.bin/tar/bsdtar.110
-rw-r--r--usr.bin/tar/bsdtar.c5
-rw-r--r--usr.bin/tar/write.c3
3 files changed, 13 insertions, 5 deletions
diff --git a/usr.bin/tar/bsdtar.1 b/usr.bin/tar/bsdtar.1
index 92b61a2..64511ec 100644
--- a/usr.bin/tar/bsdtar.1
+++ b/usr.bin/tar/bsdtar.1
@@ -405,6 +405,15 @@ Note that, unlike other
.Nm tar
implementations, this implementation recognizes gzip compression
automatically when reading archives.
+.It Fl Z
+(c mode only)
+Compress the resulting archive with
+.Xr compress 1 .
+In extract or list modes, this option is ignored.
+Note that, unlike other
+.Nm tar
+implementations, this implementation recognizes compress compression
+automatically when reading archives.
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
@@ -628,6 +637,7 @@ an archive while preserving any absolute pathnames,
components, or symlinks to other directories.
.Sh SEE ALSO
.Xr bzip2 1 ,
+.Xr compress 1 ,
.Xr cpio 1 ,
.Xr gzip 1 ,
.Xr mt 1 ,
diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c
index 6fb14c6..db90488 100644
--- a/usr.bin/tar/bsdtar.c
+++ b/usr.bin/tar/bsdtar.c
@@ -624,11 +624,6 @@ main(int argc, char **argv)
if (bsdtar->option_warn_links)
only_mode(bsdtar, "--check-links", "cr");
- /* Check other parameters only permitted in certain modes. */
- if (bsdtar->create_compression == 'Z' && bsdtar->mode == 'c') {
- bsdtar_warnc(bsdtar, 0, ".Z compression not supported");
- usage(bsdtar);
- }
if (bsdtar->create_compression != '\0') {
strcpy(buff, "-?");
buff[1] = bsdtar->create_compression;
diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c
index c7fb70e..e1103dd 100644
--- a/usr.bin/tar/write.c
+++ b/usr.bin/tar/write.c
@@ -220,6 +220,9 @@ tar_mode_c(struct bsdtar *bsdtar)
archive_write_set_compression_gzip(a);
break;
#endif
+ case 'Z':
+ archive_write_set_compression_compress(a);
+ break;
default:
bsdtar_errc(bsdtar, 1, 0,
"Unrecognized compression option -%c",
OpenPOWER on IntegriCloud