From 7bc3f3d0a3a9fc4d3e93e9a73de1b4e0fe354513c2adcd736b2a661b0a07d759 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 16 Oct 2012 11:15:42 +0000 Subject: [PATCH] - 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 --- ...01-check-existing-files-after-unpack.patch | 35 ++++++++++ quilt-setup-02-try-alternative-names.patch | 26 +++++++ ...-setup-03-remember-alternative-names.patch | 70 +++++++++++++++++++ quilt.changes | 10 +++ quilt.spec | 6 ++ 5 files changed, 147 insertions(+) create mode 100644 quilt-setup-01-check-existing-files-after-unpack.patch create mode 100644 quilt-setup-02-try-alternative-names.patch create mode 100644 quilt-setup-03-remember-alternative-names.patch diff --git a/quilt-setup-01-check-existing-files-after-unpack.patch b/quilt-setup-01-check-existing-files-after-unpack.patch new file mode 100644 index 0000000..028101a --- /dev/null +++ b/quilt-setup-01-check-existing-files-after-unpack.patch @@ -0,0 +1,35 @@ +From: Jean Delvare +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 diff --git a/quilt-setup-02-try-alternative-names.patch b/quilt-setup-02-try-alternative-names.patch new file mode 100644 index 0000000..c8027a5 --- /dev/null +++ b/quilt-setup-02-try-alternative-names.patch @@ -0,0 +1,26 @@ +From: Jean Delvare +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 diff --git a/quilt-setup-03-remember-alternative-names.patch b/quilt-setup-03-remember-alternative-names.patch new file mode 100644 index 0000000..f6a3f3c --- /dev/null +++ b/quilt-setup-03-remember-alternative-names.patch @@ -0,0 +1,70 @@ +From: Jean Delvare +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]" diff --git a/quilt.changes b/quilt.changes index aeca479..13a770d 100644 --- a/quilt.changes +++ b/quilt.changes @@ -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 diff --git a/quilt.spec b/quilt.spec index e146407..198ad64 100644 --- a/quilt.spec +++ b/quilt.spec @@ -50,6 +50,9 @@ patch2: quilt-support-vimdiff.patch Patch3: patch-wrapper-rpm.diff Patch5: suse-workaround-pseudo-release.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 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch @@ -75,6 +78,9 @@ Authors: %patch3 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 %build # --with-rpmbuild=/usr/lib/rpm/rpmb: