Add xz support.

* src/buffer.c, src/suffix.c: Add support for xz compression.
* src/tar.c: New option --xz, for compression/decompression using xz.
Re-assign -J as a short equivalent of --xz.
* doc/tar.texi, NEWS: Document --xz
This commit is contained in:
Sergey Poznyakoff
2009-03-04 16:50:31 +00:00
parent 7a968d67c8
commit c10830a35b
6 changed files with 70 additions and 10 deletions
+4 -2
View File
@@ -204,7 +204,8 @@ enum compress_type {
ct_gzip,
ct_bzip2,
ct_lzma,
ct_lzop
ct_lzop,
ct_xz
};
struct zip_magic
@@ -222,8 +223,9 @@ static struct zip_magic const magic[] = {
{ ct_compress, 2, "\037\235", "compress", "-Z" },
{ ct_gzip, 2, "\037\213", "gzip", "-z" },
{ ct_bzip2, 3, "BZh", "bzip2", "-j" },
{ ct_lzma, 6, "\xFFLZMA", "lzma", "-J" }, /* FIXME: ???? */
{ ct_lzma, 6, "\xFFLZMA", "lzma", "--lzma" }, /* FIXME: ???? */
{ ct_lzop, 4, "\211LZO", "lzop", "--lzop" },
{ ct_xz, 6, "\0xFD7zXZ", "-J" },
};
#define NMAGIC (sizeof(magic)/sizeof(magic[0]))