From 014ebed9b5712e47b434152906ef2aa4305eaa4fb32ad6f700d43352535fcb3e Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 17 Oct 2012 19:43:30 +0000 Subject: [PATCH] - quilt-setup-04-handle-zip-files.patch: Let quilt setup handle zip archives referenced in spec files (bnc#768332). OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=62 --- quilt-setup-04-handle-zip-files.patch | 106 ++++++++++++++++++++++++++ quilt.changes | 6 ++ quilt.spec | 2 + 3 files changed, 114 insertions(+) create mode 100644 quilt-setup-04-handle-zip-files.patch diff --git a/quilt-setup-04-handle-zip-files.patch b/quilt-setup-04-handle-zip-files.patch new file mode 100644 index 0000000..992f28d --- /dev/null +++ b/quilt-setup-04-handle-zip-files.patch @@ -0,0 +1,106 @@ +References: bnc#768332 + +Let quilt setup handle zip archives referenced in spec files. + +--- + quilt/scripts/inspect.in | 33 +++++++++++++++++++++++++++++++++ + quilt/setup.in | 11 +++++++++++ + 2 files changed, 44 insertions(+) + +--- a/quilt/scripts/inspect.in ++++ b/quilt/scripts/inspect.in +@@ -133,6 +133,11 @@ do + set -- $(lzma -cd "$file" | md5sum) + echo "$1 $basename" + ;; ++ Zip*) ++ # There is no uncompressed archive equivalent but ++ # still notify the user we are processing an archive. ++ echo -n "Z" >&4 ++ ;; + esac + done > $tmpdir/md5sums + echo >&4 +@@ -251,6 +256,21 @@ cat <<-'EOF' > $tmpdir/bin/wrapper + esac + } + ++ unzip_input_file() { ++ while [ $# -gt 0 ]; do ++ case "$1" in ++ -*) ++ shift ++ ;; ++ *) ++ echo "$1" ++ return ++ ;; ++ esac ++ done ++ return 1 ++ } ++ + tar_opt_C() { + case "$1" in + *C*f*) +@@ -270,6 +290,9 @@ cat <<-'EOF' > $tmpdir/bin/wrapper + # For tar, file - means read from stdin + [ "$inputfile" = "-" ] && inputfile= + ;; ++ unzip) ++ inputfile=$(unzip_input_file "$@") ++ ;; + esac + if [ -z "$inputfile" ]; then + # put data from stdin into tmpfile +@@ -309,6 +332,14 @@ cat <<-'EOF' > $tmpdir/bin/wrapper + dir=${dir// /\\ } + echo "${0##*/} ${dir:-.} $unpackfile" >&3 + ;; ++ unzip) ++ echo -n Z >&4 ++ dir=$PWD ++ dir=${dir/$RPM_BUILD_DIR} ++ dir=${dir##/} ++ dir=${dir// /\\ } ++ echo "${0##*/} ${dir:-.} $unpackfile" >&3 ++ ;; + esac + fi + +@@ -333,6 +364,7 @@ fi + + ln -s wrapper $tmpdir/bin/patch + ln -s wrapper $tmpdir/bin/tar ++ln -s wrapper $tmpdir/bin/unzip + + # let rpm do all the dirty specfile stuff ... + echo -n "### rpmbuild: " >&4 +@@ -343,6 +375,7 @@ rpmbuild --eval "%define _sourcedir $sou + --eval "%define _builddir $tmpdir/build" \ + --eval "%define __patch $tmpdir/bin/patch" \ + --eval "%define __tar $tmpdir/bin/tar" \ ++ --eval "%define __unzip $tmpdir/bin/unzip" \ + --eval "$DEFINE_FUZZ" \ + --nodeps \ + -bp "$specdir/$specfile" < /dev/null >&5 2>&5 +--- a/quilt/setup.in ++++ b/quilt/setup.in +@@ -198,6 +198,17 @@ do + cat_file "$tarball" \ + | tar xf - -C "$prefix$dir" + ;; ++ unzip) ++ tarball=$sourcedir$arg1 ++ if [ ! -e "$tarball" ] ++ then ++ printf $"File %s not found\n" "$tarball" >&2 ++ exit 1 ++ fi ++ printf $"Unpacking archive %s\n" "$tarball" ++ mkdir -p "${prefix:-.}" "$prefix$dir" ++ (cd "$prefix$dir" && unzip -qq "$tarball") ++ ;; + esac + done < $tmpfile + diff --git a/quilt.changes b/quilt.changes index 13a770d..6bf76d5 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 17 21:42:44 CEST 2012 - jdelvare@suse.de + +- quilt-setup-04-handle-zip-files.patch: Let quilt setup handle + zip archives referenced in spec files (bnc#768332). + ------------------------------------------------------------------- Tue Oct 16 13:13:36 CEST 2012 - jdelvare@suse.de diff --git a/quilt.spec b/quilt.spec index 198ad64..894281a 100644 --- a/quilt.spec +++ b/quilt.spec @@ -53,6 +53,7 @@ Patch6: quilt-stable-rebuild.patch Patch7: quilt-setup-01-check-existing-files-after-unpack.patch Patch8: quilt-setup-02-try-alternative-names.patch Patch9: quilt-setup-03-remember-alternative-names.patch +Patch10: quilt-setup-04-handle-zip-files.patch Url: http://savannah.nongnu.org/projects/quilt BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch @@ -81,6 +82,7 @@ Authors: %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 %build # --with-rpmbuild=/usr/lib/rpm/rpmb: