diff options
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/tar/tar.1 | 27 | ||||
-rw-r--r-- | gnu/usr.bin/tar/tar.c | 34 |
2 files changed, 37 insertions, 24 deletions
diff --git a/gnu/usr.bin/tar/tar.1 b/gnu/usr.bin/tar/tar.1 index 2653060..ce6a8df 100644 --- a/gnu/usr.bin/tar/tar.1 +++ b/gnu/usr.bin/tar/tar.1 @@ -6,7 +6,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 21, 2000 +.Dd December 23, 2000 .Os FreeBSD .Dt TAR 1 .Sh NAME @@ -179,6 +179,13 @@ Don't write symlinks as symlinks; write the data of the files they name. Ignore blocks of zeroes in archive (usually means End-Of-File). .It Fl -ignore-failed-read Don't exit with non-zero status on unreadable files. +.It Fl j +.It Fl y +.It Fl -bzip +.It Fl -bzip2 +.It Fl -bunzip2 +Filter the archive through +.Xr bzip2 1 . .It Fl k .It Fl -keep-old-files Keep files which already exist on disk; don't overwrite them from the archive. @@ -247,6 +254,7 @@ Show directories which were omitted while processing the archive. .It Fl -sparse Handle "sparse" files efficiently. .It Fl T Ar file +.It Fl I Ar file .It Fl -files-from Ar file Get names of files to extract or create from .Ar file , @@ -290,13 +298,6 @@ Exclude files matching the .It Fl -exclude-from Ar file Exclude files listed in .Ar file . -.It Fl y -.It Fl I -.It Fl -bzip -.It Fl -bzip2 -.It Fl -bunzip2 -Filter the archive through -.Xr bzip2 1 . .It Fl Z .It Fl -compress .It Fl -uncompress @@ -407,6 +408,16 @@ The default tape drive. .\" This next request is for sections 1, 6, 7 & 8 only .\" (command return values (to shell) and fprintf/stderr type diagnostics) .\" .Sh DIAGNOSTICS +.Sh COMPATIBILITY +The +.Fl y +is a FreeBSD localism. +The GNU tar maintainer has now choosen +.Fl j +as the offical bzip2 compression option in GNU tar 1.13.18 and later. +The +.Fl I +option is for compatibility with Solaris's tar. .Sh SEE ALSO .Xr bzip2 1 , .Xr compress 1 , diff --git a/gnu/usr.bin/tar/tar.c b/gnu/usr.bin/tar/tar.c index 7fb54f8..81add3f 100644 --- a/gnu/usr.bin/tar/tar.c +++ b/gnu/usr.bin/tar/tar.c @@ -171,9 +171,9 @@ struct option long_options[] = {"compress", 0, 0, 'Z'}, {"uncompress", 0, 0, 'Z'}, {"block-compress", 0, &f_compress_block, 1}, - {"bzip", 0, 0, 'y'}, - {"bzip2", 0, 0, 'y'}, - {"bunzip2", 0, 0, 'y'}, + {"bzip", 0, 0, 'j'}, + {"bzip2", 0, 0, 'j'}, + {"bunzip2", 0, 0, 'j'}, {"gzip", 0, 0, 'z'}, {"gunzip", 0, 0, 'z'}, {"ungzip", 0, 0, 'z'}, /* for backwards compatibility with former typo */ @@ -320,7 +320,7 @@ options (argc, argv) /* Parse options */ while ((c = getoldopt (argc, argv, - "-01234567Ab:BcC:df:F:g:GhiIkK:lL:mMnN:oOpPrRsStT:uvV:wWxX:yzZ", + "-01234567Ab:BcC:df:F:g:GhiIjkK:lL:mMnN:oOpPrRsStT:uvV:wWxX:yzZ", long_options, &ind)) != EOF) { switch (c) @@ -507,6 +507,17 @@ options (argc, argv) */ break; + case 'j': + case 'y': + if (f_compressprog) + { + msg ("Only one compression option permitted\n"); + exit (EX_ARGSBAD); + } + f_compressprog = "bzip2"; + break; + + case 'k': /* Don't overwrite files */ #ifdef NO_OPEN3 msg ("can't keep old files on this system"); @@ -602,6 +613,7 @@ options (argc, argv) break; case 'T': + case 'I': name_file = optarg; f_namefile++; break; @@ -641,16 +653,6 @@ options (argc, argv) add_exclude_file (optarg); break; - case 'I': - case 'y': - if (f_compressprog) - { - msg ("Only one compression option permitted\n"); - exit (EX_ARGSBAD); - } - f_compressprog = "bzip2"; - break; - case 'z': if (f_compressprog) { @@ -774,7 +776,7 @@ Other options:\n\ --same-owner create extracted files with the same ownership \n\ --show-omitted-dirs show omitted directories while processing the archive.\n\ -S, --sparse handle sparse files efficiently\n\ --T, --files-from F get names to extract or create from file F\n\ +-T, -I, --files-from F get names to extract or create from file F\n\ --null -T reads null-terminated names, disable -C\n\ --totals print total bytes written with --create\n\ -v, --verbose verbosely list files processed\n\ @@ -787,7 +789,7 @@ Other options:\n\ -W, --verify attempt to verify the archive after writing it\n\ --exclude PATTERN exclude files, given as a globbing PATTERN\n\ -X, --exclude-from FILE exclude files listed in FILE\n\ --y, --bzip2, --bunzip2 filter the archive through bzip2\n\ +-j, -y, --bzip, --bzip2, --bunzip2 filter the archive through bzip2\n\ -Z, --compress,\n\ --uncompress filter the archive through compress\n\ -z, --gzip,\n\ |