--- tar-1.15.91/src/buffer.c.lzma 2006-06-12 15:22:46.000000000 +0200 +++ tar-1.15.91/src/buffer.c 2006-06-29 18:21:31.000000000 +0200 @@ -196,7 +196,8 @@ enum compress_type { ct_none, ct_compress, ct_gzip, - ct_bzip2 + ct_bzip2, + ct_lzma }; struct zip_magic @@ -213,6 +214,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" }, + /* The first bytes of a LZMA compressed file describe some compression + settings and thus vary. This handles the most common case: */ + { ct_lzma, 3, "]\000\000", "lzma", "-Y" }, }; #define NMAGIC (sizeof(magic)/sizeof(magic[0])) --- tar-1.15.91/src/tar.c.lzma 2006-06-13 09:59:30.000000000 +0200 +++ tar-1.15.91/src/tar.c 2006-06-29 18:22:36.000000000 +0200 @@ -559,6 +559,8 @@ static struct argp_option options[] = { N_("control pax keywords"), GRID+8 }, {"label", 'V', N_("TEXT"), 0, N_("create archive with volume name TEXT; at list/extract time, use TEXT as a globbing pattern for volume name"), GRID+8 }, + {"lzma", 'Y', 0, 0, + N_("filter the archive through lzma using 'lzma' wrapper script"), 68 }, {"bzip2", 'j', 0, 0, N_("filter the archive through bzip2"), GRID+8 }, {"gzip", 'z', 0, 0, @@ -1354,6 +1356,10 @@ parse_opt (int key, char *arg, struct ar } break; + case 'Y': + set_use_compress_program_option ("lzma"); + break; + case 'z': set_use_compress_program_option ("gzip"); break;