summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-03-17 12:09:31 +0000
committerobrien <obrien@FreeBSD.org>1999-03-17 12:09:31 +0000
commit4be2884249eb602a6c2fc4afe26187935f039eed (patch)
treec4b95be07e2254fa683878beaaf1583db2281dfa /gnu
parent39934dac148954144321e426c4d4432a03a5679e (diff)
downloadFreeBSD-src-4be2884249eb602a6c2fc4afe26187935f039eed.zip
FreeBSD-src-4be2884249eb602a6c2fc4afe26187935f039eed.tar.gz
Add new -y/--bzip2/--bunzip2 flag. With all the ports that are going to
bzip2 as the compression mechanism, this makes life easier. Obtained from: bzip2 website
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/tar/tar.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gnu/usr.bin/tar/tar.c b/gnu/usr.bin/tar/tar.c
index a25ecfa..f0d63ef 100644
--- a/gnu/usr.bin/tar/tar.c
+++ b/gnu/usr.bin/tar/tar.c
@@ -169,6 +169,8 @@ struct option long_options[] =
{"compress", 0, 0, 'Z'},
{"uncompress", 0, 0, 'Z'},
{"block-compress", 0, &f_compress_block, 1},
+ {"bzip2", 0, 0, 'y'},
+ {"bunzip2", 0, 0, 'y'},
{"gzip", 0, 0, 'z'},
{"ungzip", 0, 0, 'z'},
{"use-compress-program", 1, 0, 18},
@@ -314,7 +316,7 @@ options (argc, argv)
/* Parse options */
while ((c = getoldopt (argc, argv,
- "-01234567Ab:BcC:df:F:g:GhikK:lL:mMnN:oOpPrRsStT:uvV:wWxX:zZ",
+ "-01234567Ab:BcC:df:F:g:GhikK:lL:mMnN:oOpPrRsStT:uvV:wWxX:yzZ",
long_options, &ind)) != EOF)
{
switch (c)
@@ -635,6 +637,15 @@ options (argc, argv)
add_exclude_file (optarg);
break;
+ case 'y':
+ if (f_compressprog)
+ {
+ msg ("Only one compression option permitted\n");
+ exit (EX_ARGSBAD);
+ }
+ f_compressprog = "bzip2";
+ break;
+
case 'z':
if (f_compressprog)
{
@@ -771,6 +782,7 @@ Other options:\n\
-W, --verify attempt to verify the archive after writing it\n\
--exclude FILE exclude file FILE\n\
-X, --exclude-from FILE exclude files listed in FILE\n\
+-y, --bzip2, --bunzip2 filter the archive through bzip2\n\
-Z, --compress,\n\
--uncompress filter the archive through compress\n\
-z, --gzip,\n\
OpenPOWER on IntegriCloud