SHA256
1
0
forked from pool/quilt

- quilt-setup-01-check-existing-files-after-unpack.patch: setup:

Check for existing files after unpacking (bnc#785167).
- quilt-setup-02-try-alternative-names.patch: setup: Try
  alternative patches/series names (bnc#785167).
- quilt-setup-03-remember-alternative-names.patch: setup: Run
  create_db (bnc#785167).

OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=61
This commit is contained in:
Jean Delvare 2012-10-16 11:15:42 +00:00 committed by Git OBS Bridge
parent d9da4a4590
commit 7bc3f3d0a3
5 changed files with 147 additions and 0 deletions

View File

@ -0,0 +1,35 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: setup: Check for existing files after unpacking
setup: check for existing files after unpacking the tar files, not
before, otherwise we check too early and a tar file containing a
"patches" directory will not be handled properly.
---
Originally (commit b704611d) existing files were checked for both
before and after unpacking the tar files. Commit 639f2f9c dropped
the second check, while I believe it should have dropped the first.
Andreas, is there any reason to check before unpacking too?
quilt/setup.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -183,8 +183,6 @@ case "$1" in
;;
esac
-check_for_existing_files || exit 1
-
while read tag dir arg1 arg2
do
case "$tag" in
@@ -203,6 +201,8 @@ do
esac
done < $tmpfile
+check_for_existing_files || exit 1
+
while read tag dir arg1 arg2
do
case "$tag" in

View File

@ -0,0 +1,26 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: setup: Try alternative patches/series names
setup: If a tar file contains a patches directory or a series file,
automatically try alternative names which are less likely to collide.
---
quilt/setup.in | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -201,7 +201,13 @@ do
esac
done < $tmpfile
-check_for_existing_files || exit 1
+if ! check_for_existing_files
+then
+ echo "Trying alternative patches and series names..." >&2
+ QUILT_PATCHES=quilt_patches
+ QUILT_SERIES=quilt_series
+ check_for_existing_files || exit 1
+fi
while read tag dir arg1 arg2
do

View File

@ -0,0 +1,70 @@
From: Jean Delvare <jdelvare@suse.de>
Subject: setup: Run create_db
Run create_db() as part of quilt setup, so that $QUILT_PATCHES and
$QUILT_SERIES are recorded for future quilt commands.
---
quilt/setup.in | 8 ++++++--
test/setup.test | 26 ++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 2 deletions(-)
--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -218,8 +218,12 @@ do
tar_file="$arg1"
;;
patch)
- [ -e "$prefix$dir/$QUILT_PATCHES" ] \
- || create_symlink "$sourcedir" "$prefix$dir/$QUILT_PATCHES"
+ if [ ! -e "$prefix$dir/$QUILT_PATCHES" ]
+ then
+ create_symlink "$sourcedir" "$prefix$dir/$QUILT_PATCHES"
+ (cd "$prefix$dir" && create_db)
+ fi
+
if [ -n "$series_file" ]
then
[ -e "$prefix$dir/$QUILT_SERIES" ] \
--- a/test/setup.test
+++ b/test/setup.test
@@ -7,7 +7,11 @@ $ diff -u dir/foo.orig dir/foo > revert.
$ diff -u dir/foo.orig dir/foo > again.diff
$ mv dir/foo.orig dir/foo
$ tar cf - dir | gzip > dir.tar.gz
+$ mkdir dir/patches
+$ echo crap > dir/patches/foo.diff
+$ tar cf - dir | gzip > dir_with_patches.tar.gz
$ rm -rf dir
+
$ cat > series
< # Source: dir.tar.gz
< # Patchdir: dir
@@ -57,6 +61,28 @@ $ quilt push -qa
> Applying patch patches/revert.diff
> Applying patch patches/again.diff
> Now at patch patches/again.diff
+$ cd ../..
+$ rm -rf "dir"
+
+# Now test the case where the tarball contains a patches directory
+$ cat > series_with_patches
+< # Source: dir_with_patches.tar.gz
+< # Patchdir: dir
+< #
+< foo.diff
+$ quilt setup series_with_patches
+> Unpacking archive dir_with_patches.tar.gz
+> Directory dir/patches exists
+> Trying alternative patches and series names...
+$ cd dir
+$ ls -l quilt_patches quilt_series | sed -e 's:.* -> ::'
+> ..
+> ../series_with_patches
+$ quilt push -qa
+> Applying patch quilt_patches/foo.diff
+> Now at patch quilt_patches/foo.diff
+$ cd ..
+$ rm -rf "dir"
# Now a basic test with space in dir name
$ mkdir "space [dir]"

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Oct 16 13:13:36 CEST 2012 - jdelvare@suse.de
- quilt-setup-01-check-existing-files-after-unpack.patch: setup:
Check for existing files after unpacking (bnc#785167).
- quilt-setup-02-try-alternative-names.patch: setup: Try
alternative patches/series names (bnc#785167).
- quilt-setup-03-remember-alternative-names.patch: setup: Run
create_db (bnc#785167).
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Mar 2 14:20:24 CET 2012 - jdelvare@suse.de Fri Mar 2 14:20:24 CET 2012 - jdelvare@suse.de

View File

@ -50,6 +50,9 @@ patch2: quilt-support-vimdiff.patch
Patch3: patch-wrapper-rpm.diff Patch3: patch-wrapper-rpm.diff
Patch5: suse-workaround-pseudo-release.patch Patch5: suse-workaround-pseudo-release.patch
Patch6: quilt-stable-rebuild.patch 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
Url: http://savannah.nongnu.org/projects/quilt Url: http://savannah.nongnu.org/projects/quilt
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch BuildArch: noarch
@ -75,6 +78,9 @@ Authors:
%patch3 -p1 %patch3 -p1
%patch5 -p1 %patch5 -p1
%patch6 -p1 %patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%build %build
# --with-rpmbuild=/usr/lib/rpm/rpmb: # --with-rpmbuild=/usr/lib/rpm/rpmb: