blob: 7b2ed908576610286989e4746317814878aa4012 [file] [log] [blame]
add support for xz
http://bugs.gentoo.org/302380
--- a/configure
+++ b/configure
@@ -1017,7 +1017,7 @@
echo $compress
else
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
@@ -1076,6 +1076,7 @@
*gzip*) ext=".gz" ;;
*bzip*) ext=".bz" ;;
*tzip*) ext=".tz" ;;
+ *xz*) ext=".xz" ;;
*pack*) ext=".z" ;;
*compress*) ext=".Z" ;;
*freeze*) ext=".F" ;;
@@ -1114,7 +1115,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
@@ -1139,6 +1140,10 @@
if [ $Funlzma != missing ]; then
unlzma="$Funlzma -c -d"
fi
+unxz=missing
+if [ $Funxz != missing ]; then
+ unxz="$Funxz -c -d"
+fi
pcat="$Fpcat"
zcat="$Fzcat"
fcat="$Ffcat"
@@ -1170,6 +1175,9 @@
lzma)
echo "Command to use for .lzma files (standard lzma)"
echo $n "[`eval echo \\$$filter`] $c" ;;
+ xz)
+ echo "Command to use for .xz files (standard xz)"
+ echo $n "[`eval echo \\$$filter`] $c" ;;
pcat)
echo "Command to use for .z files (pack/unpack)"
echo $n "[`eval echo \\$$filter`] $c" ;;
@@ -1232,6 +1240,7 @@
.gz) decompress=$gunzip ;;
.bz2) decompress=$bzip2 ;;
.lzma) decompress=$unlzma ;;
+ .xz) decompress=$unxz ;;
.z) decompress=$pcat ;;
.Z) decompress=$zcat ;;
.F) decompress=$fcat ;;
@@ -1325,6 +1334,7 @@
s,@gunzip@,$gunzip,
s,@bzip2@,$bzip2,
s,@unlzma@,$unlzma,
+s,@unxz@,$unxz,
s,@unyabba@,$unyabba,
s,@compress@,$compress,
s,@compress_ext@,$compress_ext,
--- a/src/makewhatis.sh
+++ b/src/makewhatis.sh
@@ -230,7 +230,7 @@
find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
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";
@@ -245,7 +245,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);
@@ -266,7 +266,9 @@
use_bzcat = match(filename,"\\.bz2");
if(!use_bzcat)
use_lzcat = match(filename,"\\.lzma");
- if (use_zcat || use_bzcat || use_lzcat ) {
+ if(!use_lzcat)
+ 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;
@@ -279,13 +281,15 @@
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 ~ /[;&|`$(]/) {
--- a/src/man.conf.in
+++ b/src/man.conf.in
@@ -133,6 +133,7 @@
.gz @gunzip@
.bz2 @bzip2@
.lzma @unlzma@
+.xz @unxz@
.z @pcat@
.Z @zcat@
.F @fcat@