SHA256
1
0
forked from pool/quilt
quilt/quilt-setup-03-remember-alternative-names.patch
Jean Delvare 7bc3f3d0a3 - 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
2012-10-16 11:15:42 +00:00

71 lines
1.9 KiB
Diff

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]"