diff options
author | Philipp Thomas <pth@novell.com> | 2009-11-20 20:40:25 +0100 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2009-11-20 22:55:22 +0100 |
commit | bc8f635dac379a9f830edd2922abec1fef3d4b99 (patch) | |
tree | 925f8e340c313cf7c97ade953ebfded52da0f57d | |
parent | 4df47975043d79f862822344840773b88dc015c3 (diff) | |
download | quilt-bc8f635dac379a9f830edd2922abec1fef3d4b99.tar.gz |
Enable quilt to handle compressed tarballs and patches that were compressed with lzma or xz
-rw-r--r-- | quilt.changes | 6 | ||||
-rw-r--r-- | quilt/push.in | 3 | ||||
-rw-r--r-- | quilt/scripts/inspect.in | 6 | ||||
-rw-r--r-- | quilt/scripts/parse-patch.in | 9 | ||||
-rw-r--r-- | quilt/scripts/patchfns.in | 8 | ||||
-rw-r--r-- | quilt/upgrade.in | 4 |
6 files changed, 32 insertions, 4 deletions
diff --git a/quilt.changes b/quilt.changes index bb1e526..99fa25b 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Nov 20 20:40:55 CET 2009 - pth@novell.com + +- Enable quilt to handle compressed tarballs and patches that were + compressed with lzma or xz. + +------------------------------------------------------------------- Thu Nov 5 17:54:32 CET 2009 - agruen@suse.de - patches command: Commit 2e581933a introduced a bug in scanning diff --git a/quilt/push.in b/quilt/push.in index 92e8d8b..c953e01 100644 --- a/quilt/push.in +++ b/quilt/push.in @@ -125,6 +125,9 @@ apply_patch() elif [ "${patch_file:(-4)}" = ".bz2" ] then bzip2 -cd $patch_file | "$@" 2>&1 + elif [ "${patch_file:(-3)}" = ".xz" -o "${patch_file:(-5)}" = ".lzma" ] + then + xz -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 057cbd8..e3657c6 100644 --- a/quilt/scripts/inspect.in +++ b/quilt/scripts/inspect.in @@ -100,6 +100,12 @@ do set -- $(bzip2 -cd "$file" | md5sum) echo "$1 $basename" ;; + xz*|lzma*) + echo -n "b" >&4 + echo "xz -cd $file | md5sum" >&2 + set -- $(xz -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 cb5a8e5..2da3caa 100644 --- a/quilt/scripts/parse-patch.in +++ b/quilt/scripts/parse-patch.in @@ -60,6 +60,8 @@ 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$/) { + $fh = new FileHandle("xz -cd $arg |"); } else { $fh = new FileHandle("< $arg"); } @@ -104,6 +106,13 @@ _("File %s disappeared!\n"), $tempname); _("File %s disappeared!\n"), $tempname); } $fh2 = new FileHandle("| bzip2 -c > $tempname"); + } elsif ($arg =~ /\.xz$/ || $arg =~ /\.lzma$/) { + $fh2->close(); + if (! -e $tempname) { + die sprintf( +_("File %s disappeared!\n"), $tempname); + } + $fh2 = new FileHandle("| xz -c > $tempname"); } unless ($fh2) { die "$tempname: $!\n"; diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in index 9723685..395df30 100644 --- a/quilt/scripts/patchfns.in +++ b/quilt/scripts/patchfns.in @@ -518,7 +518,7 @@ find_patch() then local patch=${1#$SUBDIR_DOWN$QUILT_PATCHES/} local bre=$(quote_bre "$patch") - set -- $(sed -e "/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\)\([ "$'\t'"]\|$\)/!d" \ + set -- $(sed -e "/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\|\.xz\|\.lzma\)\([ "$'\t'"]\|$\)/!d" \ -e 's/[ '$'\t''].*//' $SERIES) if [ $# -eq 1 ] then @@ -772,6 +772,8 @@ cat_file() gzip -cd "$filename" ;; *.bz2) bzip2 -cd "$filename" ;; + *.xz|*.lzma) + xz -cd "$filename" ;; *) cat "$filename" ;; esac @@ -790,6 +792,8 @@ cat_to_new_file() gzip -c ;; *.bz2) bzip2 -c ;; + *.xz|*.lzma) + xz -c "$filename" ;; *) cat ;; esac \ @@ -914,7 +918,7 @@ next_filename() { local patch=$1 base num base=$(echo "$patch" \ - | sed -r -e 's:(\.gz|\.bz2)$::' -e 's:(\.diff?|\.patch)$::') + | sed -r -e 's:(\.gz|\.bz2|\.xz|\.lzma)$::' -e 's:(\.diff?|\.patch)$::') num=$(echo "$base" | sed -nre 's:.*-([0-9]+)$:\1:'p) [ -n "$num" ] || num=1 echo "${base%-$num}-$((num+1))${patch#$base}" diff --git a/quilt/upgrade.in b/quilt/upgrade.in index 58278f7..2702390 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) of patch names; we have used the mangled names in +# .patch .gz .bz2 .xz .lzma) 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\)\([ \t]\|$\)' $SERIES)" + proper_name="$(grep "^$(quote_bre $patch)"'\(\|\.patch\|\.diff?\)\(\|\.gz\|\.bz2\|\.xz\|\.lzma\)\([ \t]\|$\)' $SERIES)" proper_name=${proper_name#$QUILT_PATCHES/} proper_name=${proper_name%% *} if [ -z "$proper_name" ] |