summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/man/man-1.6f/man-1.6e-lzma+xz-support.patch
blob: aae980fc7f48f76460affe392f603bf0b0d296dd (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Upstream-Status: Pending

Signed-off-by: Scott Garman <scott.a.garman@intel.com>

Index: man-1.6f/configure
===================================================================
--- man-1.6f.orig/configure	2010-12-29 14:00:35.000000000 -0800
+++ man-1.6f/configure	2010-12-29 14:27:57.584431711 -0800
@@ -1027,7 +1027,7 @@
   then
     DO_COMPRESSION=true
     compress=
-    for i in lzma bzip2 gzip bzip tzip pack compress freeze yabba
+    for i in xz lzma bzip2 gzip bzip tzip pack compress freeze yabba
     do
       eval F$i=missing
       for j in $DEFPATH
@@ -1080,6 +1080,7 @@
     fi
 
     case $compress in
+      *xz*) ext=".xz" ;;
       *lzma*) ext=".lzma" ;;
       *bzip2*) ext=".bz2" ;;
       *gzip*) ext=".gz" ;;
@@ -1123,7 +1124,7 @@
 fi
 
 # unconditionally handle uncompression
-UNCOMPRESSORS="unlzma gunzip bzip2 pcat zcat fcat unyabba"
+UNCOMPRESSORS="unxz unlzma gunzip bzip2 pcat zcat fcat unyabba"
 for i in $UNCOMPRESSORS
 do
   eval F$i=missing
@@ -1144,6 +1145,10 @@
 if [ $Fbzip2 != missing ]; then
   bzip2="$Fbzip2 -c -d"
 fi
+unxz=missing
+if [ $Funxz != missing ]; then
+  unxz="$Funxz -c -d"
+fi
 unlzma=missing
 if [ $Funlzma != missing ]; then
   unlzma="$Funlzma -c -d"
@@ -1176,6 +1181,9 @@
 	bzip2)
 	  echo "Command to use for .bz2 files (standard bzip2)"
 	  echo $n "[`eval echo \\$$filter`] $c" ;;
+	xz)
+	  echo "Command to use for .xz files (standard xz)"
+	  echo $n "[`eval echo \\$$filter`] $c" ;;
 	lzma)
 	  echo "Command to use for .lzma files (standard lzma)"
 	  echo $n "[`eval echo \\$$filter`] $c" ;;
@@ -1240,6 +1248,7 @@
 case $compress_ext in
   .gz) decompress=$gunzip ;;
   .bz2) decompress=$bzip2 ;;
+  .xz) decompress=$unxz ;;
   .lzma) decompress=$unlzma ;;
   .z) decompress=$pcat ;;
   .Z) decompress=$zcat ;;
@@ -1333,6 +1342,7 @@
 s,@zcat@,$zcat,
 s,@gunzip@,$gunzip,
 s,@bzip2@,$bzip2,
+s,@unxz@,$unxz,
 s,@unlzma@,$unlzma,
 s,@unyabba@,$unyabba,
 s,@compress@,$compress,
Index: man-1.6f/src/makewhatis.sh
===================================================================
--- man-1.6f.orig/src/makewhatis.sh	2010-12-29 14:00:35.000000000 -0800
+++ man-1.6f/src/makewhatis.sh	2010-12-29 14:16:18.821555314 -0800
@@ -242,7 +242,7 @@
 	    find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | LC_ALL=C $AWK -v MAN_NAME="$MAN_NAME" -v MAN_DESCRIPTION="$MAN_DESCRIPTION" '
 
 	    function readline() {
-              if (use_zcat || use_bzcat || use_lzcat) {
+              if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
 		result = (pipe_cmd | getline);
 		if (result < 0) {
 		  print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
@@ -257,7 +257,7 @@
 	    }
 	    
 	    function closeline() {
-              if (use_zcat || use_bzcat || use_lzcat) {
+              if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
 		return close(pipe_cmd);
 	      } else {
 		return close(filename);
@@ -278,7 +278,9 @@
 		use_bzcat = match(filename,"\\.bz2");
               if(!use_bzcat)
                 use_lzcat = match(filename,"\\.lzma");
-              if (use_zcat || use_bzcat || use_lzcat ) {
+	      if(!use_xzcat)
+                use_xzcat = match(filename,"\\.xz");
+              if (use_zcat || use_bzcat || use_lzcat || use_xzcat ) {
 		filename_no_gz = substr(filename, 0, RSTART - 1);
 	      } else {
 		filename_no_gz = filename;
@@ -291,14 +293,16 @@
 		actual_section = section;
 	      }
 	      sub(/\..*/, "", progname);
-              if (use_zcat || use_bzcat || use_lzcat) {
+              if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
 		if (use_zcat) {
 		  pipe_cmd = "zcat \"" filename "\"";
                 } else if (use_bzcat) {
 		  pipe_cmd = "bzcat \"" filename "\"";
-                } else {
+                } else if (use_lzcat) {
                   pipe_cmd = "lzcat \"" filename "\"";
-                }
+                } else {
+    		  pipe_cmd = "xzcat \"" filename "\"";
+		}
 		# try to avoid suspicious stuff
 		if (filename ~ /[;&|`$(]/) {
 		  print "ignored strange file name " filename " in " curdir > "/dev/stderr";