2005-12-28 Robert Millan
* src/buffer.c: Detect, compress and extract p7zip (with -I). * src/tar.c: Ditto. * README: Document p7zip support. * doc/tar.texi: Ditto. diff -ur tar.old/README tar/README --- tar.old/README 2005-05-15 05:59:09.000000000 +0200 +++ tar/README 2005-12-14 11:56:44.051330136 +0100 @@ -84,14 +84,15 @@ Here are a few hints which might help installing `tar' on some systems. -** gzip and bzip2. +** gzip, bzip2 and p7zip. -GNU tar uses the gzip and bzip2 programs to read and write compressed +GNU tar uses the gzip, bzip2 and p7zip programs to read and write compressed archives. If you don't have these programs already, you need to install them. Their sources can be found at: ftp://ftp.gnu.org/gnu/gzip/ http://sourceware.cygnus.com/bzip2/ +http://p7zip.sf.net/ If you see the following symptoms: diff -ur tar.old/doc/tar.texi tar/doc/tar.texi --- tar.old/doc/tar.texi 2005-12-11 15:10:53.000000000 +0100 +++ tar/doc/tar.texi 2005-12-14 11:55:12.861193144 +0100 @@ -2831,6 +2831,13 @@ @itemx --old-archive Synonym for @option{--format=v7}. address@hidden p7zip, summary address@hidden --p7zip address@hidden -I + +This option tells @command{tar} to read or write archives through address@hidden @xref{gzip}. + @opindex posix, summary @item --posix Same as @option{--format=posix}. @@ -3131,6 +3138,10 @@ @option{--incremental} address@hidden -I + address@hidden + @item -K @option{--starting-file} @@ -7182,19 +7193,20 @@ @cindex Storing archives in compressed format @GNUTAR{} is able to create and read compressed archives. It supports address@hidden and @command{bzip2} compression programs. For backward address@hidden, @command{bzip2} and @command{p7zip} compression programs. For backward compatibilty, it also supports @command{compress} command, although we strongly recommend against using it, since there is a patent covering the algorithm it uses and you could be sued for patent infringement merely by running @command{compress}! Besides, it is less -effective than @command{gzip} and @command{bzip2}. +effective than @command{gzip}, @command{bzip2} or @command{p7zip}. Creating a compressed archive is simple: you just specify a @dfn{compression option} along with the usual archive creation commands. The compression option is @option{-z} (@option{--gzip}) to create a @command{gzip} compressed archive, @option{-j} -(@option{--bzip2}) to create a @command{bzip2} compressed archive, and address@hidden (@option{--compress}) to use @command{compress} program. +(@option{--bzip2}) to create a @command{bzip2} compressed archive, address@hidden (@option{--compress}) to use @command{compress} program, and address@hidden (@option{--p7zip}) to create a @command{p7zip} compressed archive. For example: @smallexample diff -ur tar.old/src/buffer.c tar/src/buffer.c --- tar.old/src/buffer.c 2005-12-09 11:04:26.000000000 +0100 +++ tar/src/buffer.c 2005-12-14 12:00:08.988175000 +0100 @@ -181,7 +181,8 @@ ct_none, ct_compress, ct_gzip, - ct_bzip2 + ct_bzip2, + ct_p7zip }; struct zip_magic @@ -198,6 +199,7 @@ { ct_compress, 2, "\037\235", "compress", "-Z" }, { ct_gzip, 2, "\037\213", "gzip", "-z" }, { ct_bzip2, 3, "BZh", "bzip2", "-j" }, + { ct_p7zip, 6, "7z\274\257\047\034", "p7zip", "-I" }, }; #define NMAGIC (sizeof(magic)/sizeof(magic[0])) diff -ur tar.old/src/tar.c tar/src/tar.c --- tar.old/src/tar.c 2005-12-11 15:12:12.000000000 +0100 +++ tar/src/tar.c 2005-12-14 12:02:32.389374704 +0100 @@ -520,6 +520,8 @@ N_("create archive with volume name TEXT. At list/extract time, use TEXT as a globbing pattern for volume name"), GRID+8 }, {"bzip2", 'j', 0, 0, N_("filter the archive through bzip2"), GRID+8 }, + {"p7zip", 'I', 0, 0, + N_("filter the archive through p7zip"), GRID+8 }, {"gzip", 'z', 0, 0, N_("filter the archive through gzip"), GRID+8 }, {"gunzip", 0, 0, OPTION_ALIAS, NULL, GRID+8 }, @@ -1002,9 +1004,7 @@ break; case 'I': - USAGE_ERROR ((0, 0, - _("Warning: the -I option is not supported;" - " perhaps you meant -j or -T?"))); + set_use_compress_program_option ("p7zip"); break; case 'j':