SHA256
1
0
forked from pool/quilt

- 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
This commit is contained in:
Jean Delvare 2012-10-17 19:43:30 +00:00 committed by Git OBS Bridge
parent 7bc3f3d0a3
commit 014ebed9b5
3 changed files with 114 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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: