]> Dogcows Code - chaz/tar/commitdiff
Add Lzip support
authorAntonio Diaz Diaz <ant_diaz@teleline.es>
Tue, 2 Mar 2010 16:41:41 +0000 (18:41 +0200)
committerSergey Poznyakoff <gray@gnu.org.ua>
Tue, 2 Mar 2010 16:44:25 +0000 (18:44 +0200)
* configure.ac: Add TAR_COMPR_PROGRAM(lzip)
* doc/tar.texi: Reflect lzip support.
* src/buffer.c (compress_type) <ct_lzip>: New constant.
(magic): Add magic for lzip.
* src/suffix.c (compression_suffixes): Add lz.
* src/tar.c: New option --lzip.

configure.ac
doc/tar.texi
src/buffer.c
src/suffix.c
src/tar.c

index 2276b33b5d592b8eecd2cd01424001521d24f7f7..7cd8ab23d61f0d9aaee323a5ebf3f2f34274be9c 100644 (file)
@@ -128,6 +128,7 @@ fi
 TAR_COMPR_PROGRAM(compress)
 TAR_COMPR_PROGRAM(gzip)
 TAR_COMPR_PROGRAM(bzip2)
+TAR_COMPR_PROGRAM(lzip)
 TAR_COMPR_PROGRAM(lzma)
 TAR_COMPR_PROGRAM(lzop)
 TAR_COMPR_PROGRAM(xz)
index abc81df393f46fe4920583a479492dc2536783e2..ed8e5264b94b754540b2509ec1528e2f26f0c985 100644 (file)
@@ -2820,6 +2820,12 @@ backup, using @var{snapshot-file} to determine which files to backup.
 With other operations, informs @command{tar} that the archive is in
 incremental format.  @xref{Incremental Dumps}.
 
+@opsummary{lzip}
+@item --lzip
+
+This option tells @command{tar} to read or write archives through
+@command{lzip}.  @xref{gzip}.
+
 @opsummary{lzma}
 @item --lzma
 
@@ -8628,21 +8634,23 @@ switch to @samp{posix}.
 
 @cindex gzip
 @cindex bzip2
+@cindex lzip
 @cindex lzma
 @cindex lzop
 @cindex compress
 @GNUTAR{} is able to create and read compressed archives.  It supports
-@command{gzip}, @command{bzip2}, @command{lzma} and @command{lzop} compression
-programs.  For backward compatibility, it also supports
-@command{compress} command, although we strongly recommend against
-using it, because it is by far less effective than other compression
-programs@footnote{It also had patent problems in the past.}.
+@command{gzip}, @command{bzip2}, @command{lzip}, @command{lzma} and
+@command{lzop} compression programs.  For backward compatibility, it
+also supports @command{compress} command, although we strongly recommend
+against using it, because it is by far less effective than other
+compression programs@footnote{It also had patent problems in the past.}.
 
 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,
+@option{--lzip} to create an @asis{lzip} compressed archive,
 @option{-J} (@option{--xz}) to create an @asis{XZ} archive, 
 @option{--lzma} to create an @asis{LZMA} compressed
 archive, @option{--lzop} to create an @asis{LSOP} archive, and
@@ -8739,6 +8747,7 @@ suffix.  The following suffixes are recognized:
 @item @samp{.tz2} @tab @command{bzip2}
 @item @samp{.tbz2} @tab @command{bzip2}
 @item @samp{.tbz} @tab @command{bzip2}
+@item @samp{.lz} @tab @command{lzip}
 @item @samp{.lzma} @tab @command{lzma}
 @item @samp{.tlz} @tab @command{lzma}
 @item @samp{.lzo} @tab @command{lzop}
@@ -8796,6 +8805,10 @@ Filter the archive through @code{xz}.  Otherwise like
 @itemx --bzip2
 Filter the archive through @code{bzip2}.  Otherwise like @option{--gzip}.
 
+@opindex lzip
+@item --lzip
+Filter the archive through @command{lzip}.  Otherwise like @option{--gzip}.
+
 @opindex lzma
 @item --lzma
 Filter the archive through @command{lzma}.  Otherwise like @option{--gzip}.
index 61310381e88e1a8370431bd18e20cd79a7f56d5d..8147def1961246dfdef3f3704432416431c6f932 100644 (file)
@@ -201,6 +201,7 @@ enum compress_type {
   ct_compress,
   ct_gzip,
   ct_bzip2,
+  ct_lzip,
   ct_lzma,
   ct_lzop,
   ct_xz
@@ -221,6 +222,7 @@ static struct zip_magic const magic[] = {
   { ct_compress, 2, "\037\235",  COMPRESS_PROGRAM, "-Z" },
   { ct_gzip,     2, "\037\213",  GZIP_PROGRAM,     "-z"  },
   { ct_bzip2,    3, "BZh",       BZIP2_PROGRAM,    "-j" },
+  { ct_lzip,     4, "LZIP",      LZIP_PROGRAM,     "--lzip" },
   { ct_lzma,     6, "\xFFLZMA",  LZMA_PROGRAM,     "--lzma" },
   { ct_lzop,     4, "\211LZO",   LZOP_PROGRAM,     "--lzop" },
   { ct_xz,       6, "\0xFD7zXZ", XZ_PROGRAM,       "-J" },
index cd9c01a2ee87e1dae6f8c988ac151908e2a18c7d..23868c914f8577edb9081c99bcc3275753f1e87b 100644 (file)
@@ -38,6 +38,7 @@ static struct compression_suffix compression_suffixes[] = {
   { S(tbz,  BZIP2) },
   { S(tbz2, BZIP2) },
   { S(tz2,  BZIP2) },
+  { S(lz,   LZIP) },
   { S(lzma, LZMA) },
   { S(tlz,  LZMA) },
   { S(lzo,  LZOP) },
index 170871593f2754655b247d279c062b602f8214a8..da124196ad48b5f74a209e0ae2fff475e2da480f 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -281,6 +281,7 @@ enum
   INDEX_FILE_OPTION,
   KEEP_NEWER_FILES_OPTION,
   LEVEL_OPTION,
+  LZIP_OPTION,
   LZMA_OPTION,
   LZOP_OPTION,
   MODE_OPTION,
@@ -624,6 +625,7 @@ static struct argp_option options[] = {
   {"ungzip", 0, 0, OPTION_ALIAS, NULL, GRID+1 },
   {"compress", 'Z', 0, 0, NULL, GRID+1 },
   {"uncompress", 0, 0, OPTION_ALIAS, NULL, GRID+1 },
+  {"lzip", LZIP_OPTION, 0, 0, NULL, GRID+1 },
   {"lzma", LZMA_OPTION, 0, 0, NULL, GRID+1 },
   {"lzop", LZOP_OPTION, 0, 0, NULL, GRID+1 },
   {"xz", 'J', 0, 0, NULL, GRID+1 },
@@ -1271,6 +1273,10 @@ tar_help_filter (int key, const char *text, void *input)
       s = xasprintf (_("filter the archive through %s"), COMPRESS_PROGRAM);
       break;
 
+    case LZIP_OPTION:
+      s = xasprintf (_("filter the archive through %s"), LZIP_PROGRAM);
+      break;
+      
     case LZMA_OPTION:
       s = xasprintf (_("filter the archive through %s"), LZMA_PROGRAM);
       break;
@@ -1506,6 +1512,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
       }
       break;
       
+    case LZIP_OPTION:
+      set_use_compress_program_option (LZIP_PROGRAM);
+      break;
+      
     case LZMA_OPTION:
       set_use_compress_program_option (LZMA_PROGRAM);
       break;
This page took 0.031425 seconds and 4 git commands to generate.