summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2009-11-27 15:33:16 +0100
committerJean Delvare <jdelvare@suse.de>2009-11-27 15:33:16 +0100
commit7dce69b40f9eccd1d96e6a30cc2572643a5cc633 (patch)
treeee540020b31c624ac8225a4a0647f3f27791eba4
parentf214b718c74c5253b29a07b6507adb033e3435ce (diff)
downloadquilt-7dce69b40f9eccd1d96e6a30cc2572643a5cc633.tar.gz
Fix support of lzma- or xz-compressed files:
* Let xz handle lzma compatibility externally, with links. Otherwise lzma support will not work for users with only lzma installed and not xz. * "upgrade" doesn't need to care about lzma nor xz, these compression formats were not supported back in v1. * Fix cat_to_new_file() for lzma/xz files.. * Use a different letter for lzma and xz files in inspect.
-rw-r--r--quilt.changes12
-rw-r--r--quilt/push.in5
-rw-r--r--quilt/scripts/inspect.in10
-rw-r--r--quilt/scripts/parse-patch.in13
-rw-r--r--quilt/scripts/patchfns.in10
-rw-r--r--quilt/upgrade.in4
6 files changed, 44 insertions, 10 deletions
diff --git a/quilt.changes b/quilt.changes
index 681996d..1897787 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,16 @@
-------------------------------------------------------------------
+Fri Nov 27 15:26:22 CET 2009 - jdelvare@suse.de
+
+- Fix support of lzma- or xz-compressed files:
+ * Let xz handle lzma compatibility externally, with links.
+ Otherwise lzma support will not work for users with only lzma
+ installed and not xz.
+ * "upgrade" doesn't need to care about lzma nor xz, these
+ compression formats were not supported back in v1.
+ * Fix cat_to_new_file() for lzma/xz files..
+ * Use a different letter for lzma and xz files in inspect.
+
+-------------------------------------------------------------------
Wed Nov 25 20:52:52 CET 2009 - agruen@suse.de
- quilt.quiltrc: make sur eto only override QUILT_PAGER if
diff --git a/quilt/push.in b/quilt/push.in
index cca0681..d89f927 100644
--- a/quilt/push.in
+++ b/quilt/push.in
@@ -125,9 +125,12 @@ apply_patch()
elif [ "${patch_file:(-4)}" = ".bz2" ]
then
bzip2 -cd $patch_file | "$@" 2>&1
- elif [ "${patch_file:(-3)}" = ".xz" -o "${patch_file:(-5)}" = ".lzma" ]
+ elif [ "${patch_file:(-3)}" = ".xz" ]
then
xz -cd $patch_file | "$@" 2>&1
+ elif [ "${patch_file:(-5)}" = ".lzma" ]
+ then
+ lzma -cd $patch_file | "$@" 2>&1
else
"$@" -i $patch_file 2>&1
fi
diff --git a/quilt/scripts/inspect.in b/quilt/scripts/inspect.in
index 2cc568c..0bef35b 100644
--- a/quilt/scripts/inspect.in
+++ b/quilt/scripts/inspect.in
@@ -100,12 +100,18 @@ do
set -- $(bzip2 -cd "$file" | md5sum)
echo "$1 $basename"
;;
- xz*|lzma*)
- echo -n "b" >&4
+ xz*)
+ echo -n "x" >&4
echo "xz -cd $file | md5sum" >&2
set -- $(xz -cd "$file" | md5sum)
echo "$1 $basename"
;;
+ lzma*)
+ echo -n "l" >&4
+ echo "lzma -cd $file | md5sum" >&2
+ set -- $(lzma -cd "$file" | md5sum)
+ echo "$1 $basename"
+ ;;
esac
done > $tmpdir/md5sums
echo >&4
diff --git a/quilt/scripts/parse-patch.in b/quilt/scripts/parse-patch.in
index 2da3caa..959e632 100644
--- a/quilt/scripts/parse-patch.in
+++ b/quilt/scripts/parse-patch.in
@@ -60,8 +60,10 @@ foreach my $arg (@ARGV) {
$fh = new FileHandle("gzip -cd $arg |");
} elsif ($arg =~ /\.bz2$/) {
$fh = new FileHandle("bzip2 -cd $arg |");
- } elsif ($arg =~ /\.xz$/ or $arg =~ /\.lzma$/) {
+ } elsif ($arg =~ /\.xz$/) {
$fh = new FileHandle("xz -cd $arg |");
+ } elsif ($arg =~ /\.lzma$/) {
+ $fh = new FileHandle("lzma -cd $arg |");
} else {
$fh = new FileHandle("< $arg");
}
@@ -106,13 +108,20 @@ _("File %s disappeared!\n"), $tempname);
_("File %s disappeared!\n"), $tempname);
}
$fh2 = new FileHandle("| bzip2 -c > $tempname");
- } elsif ($arg =~ /\.xz$/ || $arg =~ /\.lzma$/) {
+ } elsif ($arg =~ /\.xz$/) {
$fh2->close();
if (! -e $tempname) {
die sprintf(
_("File %s disappeared!\n"), $tempname);
}
$fh2 = new FileHandle("| xz -c > $tempname");
+ } elsif ($arg =~ /\.lzma$/) {
+ $fh2->close();
+ if (! -e $tempname) {
+ die sprintf(
+_("File %s disappeared!\n"), $tempname);
+ }
+ $fh2 = new FileHandle("| lzma -c > $tempname");
}
unless ($fh2) {
die "$tempname: $!\n";
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index 6a2b885..4d53fbf 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -789,8 +789,10 @@ cat_file()
gzip -cd "$filename" ;;
*.bz2)
bzip2 -cd "$filename" ;;
- *.xz|*.lzma)
+ *.xz)
xz -cd "$filename" ;;
+ *.lzma)
+ lzma -cd "$filename" ;;
*)
cat "$filename" ;;
esac
@@ -809,8 +811,10 @@ cat_to_new_file()
gzip -c ;;
*.bz2)
bzip2 -c ;;
- *.xz|*.lzma)
- xz -c "$filename" ;;
+ *.xz)
+ xz -c ;;
+ *.lzma)
+ lzma -c ;;
*)
cat ;;
esac \
diff --git a/quilt/upgrade.in b/quilt/upgrade.in
index 2702390..58278f7 100644
--- a/quilt/upgrade.in
+++ b/quilt/upgrade.in
@@ -71,12 +71,12 @@ fi
printf $"Converting meta-data to version %s\n" "$DB_VERSION"
# Previously we have stripped standard patch extensions (.dif .diff
-# .patch .gz .bz2 .xz .lzma) of patch names; we have used the mangled names in
+# .patch .gz .bz2) of patch names; we have used the mangled names in
# .pc/applied-patches, .pc/$patch/, but not in the series file.
for patch in $(applied_patches)
do
- proper_name="$(grep "^$(quote_bre $patch)"'\(\|\.patch\|\.diff?\)\(\|\.gz\|\.bz2\|\.xz\|\.lzma\)\([ \t]\|$\)' $SERIES)"
+ proper_name="$(grep "^$(quote_bre $patch)"'\(\|\.patch\|\.diff?\)\(\|\.gz\|\.bz2\)\([ \t]\|$\)' $SERIES)"
proper_name=${proper_name#$QUILT_PATCHES/}
proper_name=${proper_name%% *}
if [ -z "$proper_name" ]