summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2012-10-25 17:42:46 +0200
committerJean Delvare <jdelvare@suse.de>2012-10-25 17:42:46 +0200
commit3fb88165288ecdfece7957cc57cdcd3bccebfd48 (patch)
tree0d6686e8ecf18d7678e69618551a04b17a622dc4
parent308f3ca388149c1f62898c1ae3ed76b1456327ba (diff)
downloadquilt-3fb88165288ecdfece7957cc57cdcd3bccebfd48.tar.gz
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.
-rw-r--r--quilt.changes1
-rw-r--r--quilt/setup.in8
-rw-r--r--test/setup.test26
3 files changed, 33 insertions, 2 deletions
diff --git a/quilt.changes b/quilt.changes
index 1c21b69..b79597e 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -3,6 +3,7 @@ Thu Oct 25 15:05:42 CEST 2012 - jdelvare@suse.de
- setup: Check for existing files after unpacking, not before.
- setup: Try alternative patches/series names.
+- setup: Run create_db().
-------------------------------------------------------------------
Thu Oct 25 15:05:10 CEST 2012 - jdelvare@suse.de
diff --git a/quilt/setup.in b/quilt/setup.in
index bbf26e9..712de90 100644
--- 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" ] \
diff --git a/test/setup.test b/test/setup.test
index e94ef3f..b52614c 100644
--- a/test/setup.test
+++ b/test/setup.test
@@ -7,7 +7,11 @@ $ diff -u dir/foo.orig dir/foo > revert.diff
$ 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]"