aboutsummaryrefslogtreecommitdiff
path: root/patches/0012-pax-Support-xz-compression-with-J-flag.patch
blob: 00f8a8b92c646acc55ab7d650f54da3550afc08c (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
From ac4a17dd01df3889bac917b0dc34ba9fd15aa7fe Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 3 Dec 2016 23:50:27 -0800
Subject: [PATCH] pax: Support xz compression with -J flag

---
 bin/pax/options.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/bin/pax/options.c b/bin/pax/options.c
index c7e64a5d22c..917414c999a 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -154,6 +154,7 @@ static int xz_id(char *_blk, int _size);
 #define GZIP_CMD	"gzip"		/* command to run as gzip */
 #define COMPRESS_CMD	"compress"	/* command to run as compress */
 #define BZIP2_CMD	"bzip2"		/* command to run as bzip2 */
+#define XZ_CMD		"xz"		/* command to run as xz */
 
 /*
  *	Format specific routine table
@@ -300,7 +301,7 @@ pax_options(int argc, char **argv)
 	/*
 	 * process option flags
 	 */
-	while ((c=getopt(argc,argv,"ab:cdf:ijklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ0"))
+	while ((c=getopt(argc,argv,"ab:cdf:ijklno:p:rs:tuvwx:zB:DE:G:HJLOPT:U:XYZ0"))
 	    != -1) {
 		switch (c) {
 		case 'a':
@@ -556,6 +557,12 @@ pax_options(int argc, char **argv)
 			Hflag = 1;
 			flg |= CHF;
 			break;
+		case 'J':
+			/*
+			 * use xz.  Non standard option.
+			 */
+			gzip_program = XZ_CMD;
+			break;
 		case 'L':
 			/*
 			 * follow symlinks
@@ -731,7 +738,7 @@ tar_options(int argc, char **argv)
 	 * process option flags
 	 */
 	while ((c = getoldopt(argc, argv,
-	    "b:cef:hjmopqruts:vwxzBC:HI:LNOPXZ014578")) != -1) {
+	    "b:cef:hjmopqruts:vwxzBC:HI:JLNOPXZ014578")) != -1) {
 		switch (c) {
 		case 'b':
 			/*
@@ -880,6 +887,12 @@ tar_options(int argc, char **argv)
 			incfiles[nincfiles - 1].file = optarg;
 			incfiles[nincfiles - 1].dir = chdname;
 			break;
+		case 'J':
+			/*
+			 * use xz.  Non standard option.
+			 */
+			gzip_program = XZ_CMD;
+			break;
 		case 'L':
 			/*
 			 * follow symlinks
@@ -1164,7 +1177,7 @@ cpio_options(int argc, char **argv)
 	dflag = 1;
 	act = -1;
 	nodirs = 1;
-	while ((c=getopt(argc,argv,"abcdfijklmoprstuvzABC:E:F:H:I:LO:SZ6")) != -1)
+	while ((c=getopt(argc,argv,"abcdfijklmoprstuvzABC:E:F:H:I:JLO:SZ6")) != -1)
 		switch (c) {
 			case 'a':
 				/*
@@ -1348,6 +1361,12 @@ cpio_options(int argc, char **argv)
 				(void)fputs("\n\n", stderr);
 				cpio_usage();
 				break;
+			case 'J':
+				/*
+				 * use xz.  Non standard option.
+				 */
+				gzip_program = XZ_CMD;
+				break;
 			case 'L':
 				/*
 				 * follow symbolic links
-- 
2.26.2