summaryrefslogtreecommitdiff
path: root/Build/source/utils/lzma-utils/extra/tar/tar-1.18.patch
blob: c92ab235fa0763cea60de94aee9e3e267704e051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Description
#
#     This patch adds `-a' and a long option equivalent `--lzma'
#     to GNU tar 1.18.
#
# Changes
#
#     2007-08-10 - Updated the patch to work with GNU tar 1.18.
#
#     2007-08-10 - Use `-a' instead of of `-Y'. BusyBox already uses `-a'
#                  and that conflicts less with other tar implementations
#                  than `-Y'.
#
#     2006-08-16 - Updated magic byte detection for the new .lzma format.
#
#     2005-12-23 - Updated to use the new lzma command line tool which
#                  replaced the ugly lzmash wrapper script.
#
#     2005-05-06 - Initial version using lzmash wrapper script
#
# Copyright information
#
#     GNU tar is copyright by Free Software Foundation, Inc.
#     This patch was written by Lasse Collin <lasse.collin@tukaani.org>.
#
#     GNU tar is distributed under the GNU GPL. However, the author of
#     this patch puts the changes made by him into the public domain.

diff -ru tar-1.18.orig/src/buffer.c tar-1.18/src/buffer.c
--- tar-1.18.orig/src/buffer.c	2007-06-27 16:30:31.000000000 +0300
+++ tar-1.18/src/buffer.c	2007-08-10 23:03:33.430394635 +0300
@@ -205,7 +205,8 @@
   ct_none,
   ct_compress,
   ct_gzip,
-  ct_bzip2
+  ct_bzip2,
+  ct_lzma
 };
 
 struct zip_magic
@@ -222,6 +223,7 @@
   { 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", "-a" },
 };
 
 #define NMAGIC (sizeof(magic)/sizeof(magic[0]))
diff -ru tar-1.18.orig/src/tar.c tar-1.18/src/tar.c
--- tar-1.18.orig/src/tar.c	2007-06-27 16:30:32.000000000 +0300
+++ tar-1.18/src/tar.c	2007-08-10 23:03:33.430394635 +0300
@@ -574,6 +574,8 @@
    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", 'a', 0, 0,
+   N_("filter the archive through lzma"), GRID+8 },
   {"bzip2", 'j', 0, 0,
    N_("filter the archive through bzip2"), GRID+8 },
   {"gzip", 'z', 0, 0,
@@ -1184,6 +1186,10 @@
       args->input_files = true;
       break;
 
+    case 'a':
+      set_use_compress_program_option ("lzma");
+      break;
+
     case 'A':
       set_subcommand_option (CAT_SUBCOMMAND);
       break;