[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-tar] Re: Lzip support in GNU tar 1.23 (patch)
From: |
Antonio Diaz Diaz |
Subject: |
[Bug-tar] Re: Lzip support in GNU tar 1.23 (patch) |
Date: |
Wed, 17 Feb 2010 16:26:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905 |
Kevin Day wrote:
The magic header is pretty easy:
modify buffer.c to have this:
{ ct_lzip, 4, "LZIP", "lzip", "--lzip" },
Sergey, I suppose you are busy, so I attach a patch with all the needed
changes.
Best regards,
Antonio.
diff -urdN tar-1.22.91/configure.ac tar-1.22.91.new/configure.ac
--- tar-1.22.91/configure.ac 2010-02-12 09:11:04.000000000 +0100
+++ tar-1.22.91.new/configure.ac 2010-02-17 14:10:41.000000000 +0100
@@ -128,6 +128,7 @@
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)
diff -urdN tar-1.22.91/doc/tar.texi tar-1.22.91.new/doc/tar.texi
--- tar-1.22.91/doc/tar.texi 2010-01-27 19:54:03.000000000 +0100
+++ tar-1.22.91.new/doc/tar.texi 2010-02-17 15:57:20.000000000 +0100
@@ -2820,6 +2820,12 @@
With other operations, informs @command{tar} that the archive is in
incremental format. @xref{Incremental Dumps}.
address@hidden
address@hidden --lzip
+
+This option tells @command{tar} to read or write archives through
address@hidden @xref{gzip}.
+
@opsummary{lzma}
@item --lzma
@@ -8605,21 +8611,23 @@
@cindex gzip
@cindex bzip2
address@hidden lzip
@cindex lzma
@cindex lzop
@cindex compress
@GNUTAR{} is able to create and read compressed archives. It supports
address@hidden, @command{bzip2}, @command{lzma} and @command{lzop} compression
-programs. For backward compatibility, it also supports
address@hidden command, although we strongly recommend against
-using it, because it is by far less effective than other compression
address@hidden also had patent problems in the past.}.
address@hidden, @command{bzip2}, @command{lzip}, @command{lzma} and
address@hidden 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 address@hidden 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,
address@hidden 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
@@ -8716,6 +8724,7 @@
@item @samp{.tz2} @tab @command{bzip2}
@item @samp{.tbz2} @tab @command{bzip2}
@item @samp{.tbz} @tab @command{bzip2}
address@hidden @samp{.lz} @tab @command{lzip}
@item @samp{.lzma} @tab @command{lzma}
@item @samp{.tlz} @tab @command{lzma}
@item @samp{.lzo} @tab @command{lzop}
@@ -8773,6 +8782,10 @@
@itemx --bzip2
Filter the archive through @code{bzip2}. Otherwise like @option{--gzip}.
address@hidden lzip
address@hidden --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}.
diff -urdN tar-1.22.91/src/buffer.c tar-1.22.91.new/src/buffer.c
--- tar-1.22.91/src/buffer.c 2010-01-27 19:54:03.000000000 +0100
+++ tar-1.22.91.new/src/buffer.c 2010-02-17 14:10:41.000000000 +0100
@@ -201,6 +201,7 @@
ct_compress,
ct_gzip,
ct_bzip2,
+ ct_lzip,
ct_lzma,
ct_lzop,
ct_xz
@@ -221,6 +222,7 @@
{ 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" },
diff -urdN tar-1.22.91/src/suffix.c tar-1.22.91.new/src/suffix.c
--- tar-1.22.91/src/suffix.c 2010-01-27 19:54:03.000000000 +0100
+++ tar-1.22.91.new/src/suffix.c 2010-02-17 14:10:41.000000000 +0100
@@ -38,6 +38,7 @@
{ S(tbz, BZIP2) },
{ S(tbz2, BZIP2) },
{ S(tz2, BZIP2) },
+ { S(lz, LZIP) },
{ S(lzma, LZMA) },
{ S(tlz, LZMA) },
{ S(lzo, LZOP) },
diff -urdN tar-1.22.91/src/tar.c tar-1.22.91.new/src/tar.c
--- tar-1.22.91/src/tar.c 2010-01-27 19:54:03.000000000 +0100
+++ tar-1.22.91.new/src/tar.c 2010-02-17 15:57:20.000000000 +0100
@@ -281,6 +281,7 @@
INDEX_FILE_OPTION,
KEEP_NEWER_FILES_OPTION,
LEVEL_OPTION,
+ LZIP_OPTION,
LZMA_OPTION,
LZOP_OPTION,
MODE_OPTION,
@@ -624,6 +625,7 @@
{"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 @@
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 @@
}
break;
+ case LZIP_OPTION:
+ set_use_compress_program_option (LZIP_PROGRAM);
+ break;
+
case LZMA_OPTION:
set_use_compress_program_option (LZMA_PROGRAM);
break;