summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-02-20 14:30:45 +0000
committerAndreas Gruenbacher <agruen@suse.de>2004-02-20 14:30:45 +0000
commitbd0773bed9c43affd7f0af8b04fa9850bdd588b2 (patch)
tree381c147a8a42ed8f595c0446f8f67fcb31e29ad8
parent2e083b83410563b1bc5ff8b2379315178ccc7bfd (diff)
downloadquilt-bd0773bed9c43affd7f0af8b04fa9850bdd588b2.tar.gz
- Sub-directory support:
+ Fix another bug that triggers when /patches exists. + Working in sub-directories: Force `quilt new' to always create the new patch in the current working directory even if there is a patches/ sub-directory further up the directory tree. This should restore the behavior from before Jan 28 very well. - quilt files, diff, refresh: Sort the files in the patch alphabetically.
-rw-r--r--configure.ac4
-rw-r--r--quilt.changes12
-rw-r--r--quilt/diff.in2
-rw-r--r--quilt/files.in2
-rw-r--r--quilt/new.in7
-rw-r--r--quilt/refresh.in2
-rw-r--r--scripts/patchfns.in4
-rw-r--r--test/new-nosubdir.test11
-rw-r--r--test/reorder.test21
-rw-r--r--test/snapshot2.test7
-rw-r--r--test/two.test13
11 files changed, 64 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac
index eaad403..a43a180 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([quilt],[0.30],[quilt-dev@nongnu.org])
+AC_INIT([quilt],[0.31],[quilt-dev@nongnu.org])
AC_CONFIG_AUX_DIR(config)
AC_PREREQ(2.53)
-AC_REVISION ($Revision: 1.24 $)
+AC_REVISION ($Revision: 1.25 $)
PACKAGE_RELEASE=1
AC_SUBST(PACKAGE_RELEASE)
diff --git a/quilt.changes b/quilt.changes
index 4828635..497ca03 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,16 @@
-------------------------------------------------------------------
+Fri Feb 20 14:30:11 CET 2004 - agruen@suse.de
+
+- Sub-directory support:
+ + Fix another bug that triggers when /patches exists.
+ + Working in sub-directories: Force `quilt new' to always create
+ the new patch in the current working directory even if there
+ is a patches/ sub-directory further up the directory tree.
+ This should restore the behavior from before Jan 28 very well.
+- quilt files, diff, refresh: Sort the files in the patch
+ alphabetically.
+
+-------------------------------------------------------------------
Sun Feb 15 15:53:42 CET 2004 - agruen@suse.de
- Never fail when patching temporary files in `quilt diff -z',
diff --git a/quilt/diff.in b/quilt/diff.in
index 36f3dbb..9973ed5 100644
--- a/quilt/diff.in
+++ b/quilt/diff.in
@@ -226,7 +226,7 @@ fi
for patch in ${patches[@]}
do
- for file in $(files_in_patch $patch)
+ for file in $(files_in_patch $patch | sort)
do
if [ ${#opt_files[@]} -gt 0 ] && \
! in_array "$file" "${opt_files[@]#./}"
diff --git a/quilt/files.in b/quilt/files.in
index cc62b6b..9166ebb 100644
--- a/quilt/files.in
+++ b/quilt/files.in
@@ -88,7 +88,7 @@ then
fi
fi
-for file in $(files_in_patch $patch)
+for file in $(files_in_patch $patch | sort)
do
status=" "
if [ -s $(backup_file_name $patch $file) ]
diff --git a/quilt/new.in b/quilt/new.in
index 00d16ea..e491ffb 100644
--- a/quilt/new.in
+++ b/quilt/new.in
@@ -58,6 +58,13 @@ fi
patch=${1#$QUILT_PATCHES/}
+if [ -n "$SUBDIR" ]
+then
+ echo $"Warning: directory $(echo $SUBDIR | sed -e 's:[^/]\+:..:g')$QUILT_PATCHES exists; ignoring"
+ cd $SUBDIR
+ unset SUBDIR
+fi
+
if patch_in_series $patch
then
echo $"Patch $patch exists already"
diff --git a/quilt/refresh.in b/quilt/refresh.in
index 385cc55..170cc30 100644
--- a/quilt/refresh.in
+++ b/quilt/refresh.in
@@ -128,7 +128,7 @@ trap "die 1" SIGTERM
tmpfile=$(gen_tempfile)
-for file in $(files_in_patch $patch)
+for file in $(files_in_patch $patch | sort)
do
old_file=$(backup_file_name $patch $file)
next_patch=$(next_patch_for_file $patch $file)
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index f59e72b..9b37e47 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -43,9 +43,9 @@ then
if [ -d "$basedir/$QUILT_PATCHES" ]
then
SUBDIR="${PWD#$basedir/}/"
- if ! cd $basedir
+ if ! cd $basedir/
then
- echo "Cannot change into parent directory $basedir" >&2
+ echo "Cannot change into parent directory $basedir/" >&2
exit 1
fi
break
diff --git a/test/new-nosubdir.test b/test/new-nosubdir.test
new file mode 100644
index 0000000..e1008f3
--- /dev/null
+++ b/test/new-nosubdir.test
@@ -0,0 +1,11 @@
+ $ mkdir d
+ $ cd d
+
+ $ mkdir patches sub
+ $ cd sub
+ $ quilt new here.diff
+ > Warning: directory ../../patches exists; ignoring
+ > Patch here.diff is now on top
+
+ $ cd ../..
+ $ rm -rf d
diff --git a/test/reorder.test b/test/reorder.test
index 154e2e9..b592932 100644
--- a/test/reorder.test
+++ b/test/reorder.test
@@ -6,13 +6,13 @@ Regression test: Quilt did reorder files in patches.
$ echo one > g
$ mkdir patches
$ cat > patches/test.diff
- < --- g.orig 2003-04-09 01:48:01.000000000 +0200
- < +++ g 2003-04-09 01:49:17.000000000 +0200
+ < --- g.orig
+ < +++ g
< @@ -1 +1 @@
< -one
< +two
- < --- f.orig 2003-04-09 01:48:01.000000000 +0200
- < +++ f 2003-04-09 01:49:17.000000000 +0200
+ < --- f.orig
+ < +++ f
< @@ -1 +1 @@
< -one
< +two
@@ -30,8 +30,8 @@ Regression test: Quilt did reorder files in patches.
$ echo one > h
$ sleep 2
$ cat >> patches/test.diff
- < --- h.orig 2003-04-09 01:48:01.000000000 +0200
- < +++ h 2003-04-09 01:49:17.000000000 +0200
+ < --- h.orig
+ < +++ h
< @@ -1 +1 @@
< -one
< +two
@@ -41,9 +41,16 @@ Regression test: Quilt did reorder files in patches.
> Now at patch test.diff
$ quilt files
- > g
> f
+ > g
> h
+ $ quilt refresh
+ > Refreshed patch test.diff
+ $ grep "^+++ " patches/test.diff
+ > +++ f
+ > +++ g
+ > +++ h
+
$ cd ..
$ rm -rf d
diff --git a/test/snapshot2.test b/test/snapshot2.test
index e8aa8a8..b0d91e7 100644
--- a/test/snapshot2.test
+++ b/test/snapshot2.test
@@ -1,8 +1,9 @@
- $ mkdir -p d/patches d/d
- $ cd d/d
-
+ $ mkdir -p d/d
+ $ cd d
$ quilt new snapshot
> Patch snapshot is now on top
+
+ $ cd d
$ quilt add f.txt
> File d/f.txt added to patch snapshot
$ cat > f.txt
diff --git a/test/two.test b/test/two.test
index e365afe..372dd72 100644
--- a/test/two.test
+++ b/test/two.test
@@ -1,12 +1,13 @@
(To run, type `./run two.test' in this directory.)
- $ mkdir -p d/patches d/d
- $ cd d/d
- $ mkdir dir
- $ echo "This is file one." > dir/file1
+ $ mkdir -p d/d
+ $ cd d
$ quilt new patch1.diff
> Patch patch1.diff is now on top
+ $ cd d
+ $ mkdir dir
+ $ echo "This is file one." > dir/file1
$ quilt add dir/file1
> File d/dir/file1 added to patch patch1.diff
@@ -64,9 +65,11 @@
$ quilt refresh
> Refreshed patch patch1.diff
+ $ cd ..
$ quilt new patch2.diff
> Patch patch2.diff is now on top
+ $ cd d
$ quilt add dir/file3
> File d/dir/file3 added to patch patch2.diff
@@ -96,9 +99,11 @@
>
> Now at patch patch2.diff
+ $ cd ..
$ quilt new subdir/patch3.diff
> Patch subdir/patch3.diff is now on top
+ $ cd d
$ quilt add file4
> File d/file4 added to patch subdir/patch3.diff