* 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
+2009-03-04 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ 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.
+
2009-01-19 Sergey Poznyakoff <gray@gnu.org.ua>
* doc/tar.texi: Fix typo.
-GNU tar NEWS - User visible changes. 2008-12-27
+GNU tar NEWS - User visible changes. 2009-03-04
Please send GNU tar bug reports to <bug-tar@gnu.org>
+\f
+version 1.21.90 (CVS)
+
+* Support for xz compression
+
+Tar uses xz for compression if at least one of the following
+conditions is met:
+
+ 1. The option --xz or -J (see below) is used.
+ 2. The xz binary is set as compressor using --use-compress-program option.
+ 3. The file name of the archive being created ends in `.xz' and
+ auto-compress option (-a) is used.
+
+Xz is used for decompression if at least one of the following
+conditions is met:
+
+ 1. The option --xz or -J is used.
+ 2. The xz binary is set as compressor using --use-compress-program option.
+ 3. The file is recognized as xz compressed stream data.
+
+* Short option -J
+
+The decision to assign -J option was taken just before the XZ format
+has been officially declared stable. Now, that stable xz tools are
+available, the -J option is re-assigned as a short equivalent of --xz.
+
+* New option -I
+
+The -I option is assigned as a short equivalent for
+--use-compress-program.
+
\f
version 1.21 - Sergey Poznyakoff, 2008-12-27
@opsummary{lzma}
@item --lzma
-@itemx -J
This option tells @command{tar} to read or write archives through
@command{lzma}. @xref{gzip}.
@item --wildcards-match-slash
Wildcards match @samp{/}.
@xref{controlling pattern-matching}.
+
+@opsummary{xz}
+@item --xz
+@itemx -J
+Use @command{xz} for compressing or decompressing the archives. @xref{gzip}.
+
@end table
@node Short Option Summary
@item -G @tab @ref{--incremental}.
-@item -J @tab @ref{--lzma}.
+@item -J @tab @ref{--xz}.
@item -K @tab @ref{--starting-file}.
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{-J} (@option{--lzma}) to create an @asis{LZMA} compressed
+@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
@option{-Z} (@option{--compress}) to use @command{compress} program.
For example:
@item @samp{.lzma} @tab @command{lzma}
@item @samp{.tlz} @tab @command{lzma}
@item @samp{.lzo} @tab @command{lzop}
+@item @samp{.xz} @tab @command{xz}
@end multitable
@opindex gzip
So, there are pros and cons. We'll see!
@opindex bzip2
+@item -J
+@itemx --xz
+Filter the archive through @code{xz}. Otherwise like
+@option{--gzip}.
+
@item -j
@itemx --bzip2
Filter the archive through @code{bzip2}. Otherwise like @option{--gzip}.
@opindex lzma
@item --lzma
-@itemx -J
Filter the archive through @command{lzma}. Otherwise like @option{--gzip}.
@opindex lzop
ct_gzip,
ct_bzip2,
ct_lzma,
- ct_lzop
+ ct_lzop,
+ ct_xz
};
struct zip_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]))
{ S(lzma, lzma) },
{ S(tlz, lzma) },
{ S(lzo, lzop) },
+ { S(xz, xz) },
#undef S
};
IGNORE_FAILED_READ_OPTION,
INDEX_FILE_OPTION,
KEEP_NEWER_FILES_OPTION,
+ LZMA_OPTION,
LZOP_OPTION,
MODE_OPTION,
MTIME_OPTION,
{"auto-compress", 'a', 0, 0,
N_("use archive suffix to determine the compression program"), GRID+1 },
{"no-auto-compress", NO_AUTO_COMPRESS_OPTION, 0, 0,
- N_("do not use use archive suffix to determine the compression program"),
+ N_("do not use archive suffix to determine the compression program"),
GRID+1 },
{"bzip2", 'j', 0, 0,
N_("filter the archive through bzip2"), GRID+1 },
{"compress", 'Z', 0, 0,
N_("filter the archive through compress"), GRID+1 },
{"uncompress", 0, 0, OPTION_ALIAS, NULL, GRID+1 },
- {"lzma", 'J', 0, 0,
+ {"lzma", LZMA_OPTION, 0, 0,
N_("filter the archive through lzma"), GRID+1 },
{"lzop", LZOP_OPTION, 0, 0,
N_("filter the archive through lzop"), GRID+8 },
+ {"xz", 'J', 0, 0,
+ N_("filter the archive through xz"), GRID+8 },
{"use-compress-program", 'I', N_("PROG"), 0,
N_("filter through PROG (must accept -d)"), GRID+1 },
#undef GRID
break;
case 'J':
- set_use_compress_program_option ("lzma");
+ set_use_compress_program_option ("xz");
break;
case 'k':
}
break;
+ case LZMA_OPTION:
+ set_use_compress_program_option ("lzma");
+ break;
+
case LZOP_OPTION:
set_use_compress_program_option ("lzop");
break;