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