Enable and document the -Z option for selecting "compress" compression,

now that libarchive supports it.
This commit is contained in:
kientzle 2008-03-15 02:41:44 +00:00
parent 4c7ea30e33
commit 4d2ae21512
3 changed files with 13 additions and 5 deletions

View File

@ -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 ,

View File

@ -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;

View File

@ -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",