linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
0010-pax-Support-xz-compression-with-J-flag.patch
(2489B)
1 From c0b84520a7c92b67b195c6ec9ed9185438810380 Mon Sep 17 00:00:00 2001
2 From: Michael Forney <mforney@mforney.org>
3 Date: Sat, 3 Dec 2016 23:50:27 -0800
4 Subject: [PATCH] pax: Support xz compression with -J flag
5
6 ---
7 bin/pax/options.c | 25 ++++++++++++++++++++++---
8 1 file changed, 22 insertions(+), 3 deletions(-)
9
10 diff --git a/bin/pax/options.c b/bin/pax/options.c
11 index 9dd2ea0ce25..63f17f2c1c7 100644
12 --- a/bin/pax/options.c
13 +++ b/bin/pax/options.c
14 @@ -156,6 +156,7 @@ static int xz_id(char *_blk, int _size);
15 #define GZIP_CMD "gzip" /* command to run as gzip */
16 #define COMPRESS_CMD "compress" /* command to run as compress */
17 #define BZIP2_CMD "bzip2" /* command to run as bzip2 */
18 +#define XZ_CMD "xz" /* command to run as xz */
19
20 /*
21 * Format specific routine table
22 @@ -312,7 +313,7 @@ pax_options(int argc, char **argv)
23 /*
24 * process option flags
25 */
26 - while ((c=getopt(argc,argv,"ab:cdf:ijklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ0"))
27 + while ((c=getopt(argc,argv,"ab:cdf:ijklno:p:rs:tuvwx:zB:DE:G:HJLOPT:U:XYZ0"))
28 != -1) {
29 switch (c) {
30 case 'a':
31 @@ -568,6 +569,12 @@ pax_options(int argc, char **argv)
32 Hflag = 1;
33 flg |= CHF;
34 break;
35 + case 'J':
36 + /*
37 + * use xz. Non standard option.
38 + */
39 + gzip_program = XZ_CMD;
40 + break;
41 case 'L':
42 /*
43 * follow symlinks
44 @@ -744,7 +751,7 @@ tar_options(int argc, char **argv)
45 * process option flags
46 */
47 while ((c = getoldopt(argc, argv,
48 - "b:cef:hjmopqruts:vwxzBC:F:HI:LNOPXZ014578")) != -1) {
49 + "b:cef:hjmopqruts:vwxzBC:F:HI:JLNOPXZ014578")) != -1) {
50 switch (c) {
51 case 'b':
52 /*
53 @@ -911,6 +918,12 @@ tar_options(int argc, char **argv)
54 incfiles[nincfiles - 1].file = optarg;
55 incfiles[nincfiles - 1].dir = chdname;
56 break;
57 + case 'J':
58 + /*
59 + * use xz. Non standard option.
60 + */
61 + gzip_program = XZ_CMD;
62 + break;
63 case 'L':
64 /*
65 * follow symlinks
66 @@ -1194,7 +1207,7 @@ cpio_options(int argc, char **argv)
67 dflag = 1;
68 act = -1;
69 nodirs = 1;
70 - while ((c=getopt(argc,argv,"abcdfijklmoprstuvzABC:E:F:H:I:LO:SZ6")) != -1)
71 + while ((c=getopt(argc,argv,"abcdfijklmoprstuvzABC:E:F:H:I:JLO:SZ6")) != -1)
72 switch (c) {
73 case 'a':
74 /*
75 @@ -1378,6 +1391,12 @@ cpio_options(int argc, char **argv)
76 (void)fputs("\n\n", stderr);
77 cpio_usage();
78 break;
79 + case 'J':
80 + /*
81 + * use xz. Non standard option.
82 + */
83 + gzip_program = XZ_CMD;
84 + break;
85 case 'L':
86 /*
87 * follow symbolic links
88 --
89 2.49.0
90