summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2005-11-28 00:46:13 +0000
committerAndreas Gruenbacher <agruen@suse.de>2005-11-28 00:46:13 +0000
commit53819365cf8b1dad870cf97a1f33bd7579f6b6ed (patch)
treea3737a06f43257905c91cb4ec3cc3635953e83f8
parent95ba9d63e774ecfcdd553ce8a5c31e451e075408 (diff)
downloadquilt-53819365cf8b1dad870cf97a1f33bd7579f6b6ed.tar.gz
- quilt/diff.in, quilt/refresh.in: stop using /dev/null for added
or removed files: GNU diff does not do that either, and for removed files this leads to headers that only reference $file.orig and /dev/null, so the actual file is not found. (This is only truly fixes -p0 style patches as -p1 style patches use dir.orig/file instead of dir/file.orig so the filename is not lost, but stopping to use /dev/null makes sense for -p style patches just the same. - files command: remove a redundant find_patch(). - Make top_patch() fail if there is no top patch.
-rw-r--r--quilt.changes14
-rw-r--r--quilt/files.in7
-rw-r--r--scripts/patchfns.in5
-rw-r--r--test/null-bug.test24
4 files changed, 43 insertions, 7 deletions
diff --git a/quilt.changes b/quilt.changes
index 345cb6b..8c1cecb 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,18 @@
-------------------------------------------------------------------
+Mon Nov 28 01:34:05 CET 2005 - agruen@suse.de
+
+- quilt/diff.in, quilt/refresh.in: stop using /dev/null for added
+ or removed files: GNU diff does not do that either, and for
+ removed files this leads to headers that only reference
+ $file.orig and /dev/null, so the actual file is not found. (This
+ is only truly fixes -p0 style patches as -p1 style patches use
+ dir.orig/file instead of dir/file.orig so the filename is not
+ lost, but stopping to use /dev/null makes sense for -p style
+ patches just the same.
+- files command: remove a redundant find_patch().
+- Make top_patch() fail if there is no top patch.
+
+-------------------------------------------------------------------
Fri Nov 4 16:21:58 CET 2005 - agruen@suse.de
- Makefile.in: don't strip the backup-files binary in the install
diff --git a/quilt/files.in b/quilt/files.in
index 385be36..f57a4aa 100644
--- a/quilt/files.in
+++ b/quilt/files.in
@@ -87,13 +87,12 @@ if [ $# -gt 1 ]
then
usage
fi
-last_patch=$(find_patch $1)
-if [ -n "$last_patch" ]
+if [ -n "$1" ]
then
- if ! patch=$(find_patch $last_patch)
+ if ! last_patch=$(find_patch $1)
then
- printf $"Patch %s is not in series file\n" "$last_patch" >&2
+ printf $"Patch %s is not in series file\n" "$1" >&2
exit 1
fi
else
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index ec4f865..714c7a6 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -314,7 +314,8 @@ cat_series()
top_patch()
{
- [ -e $DB ] && tail -n 1 $DB
+ local patch=$(tail -n 1 $DB 2>/dev/null)
+ [ -n "$patch" ] && echo "$patch"
}
is_numeric()
@@ -538,7 +539,6 @@ diff_file()
if ! [ -s "$old_file" ]
then
old_file=/dev/null
- old_hdr=/dev/null
[ -n "$QUILT_NO_DIFF_TIMESTAMPS" ] \
|| old_date=$'\t'"1970-01-01 00:00:00.000000000 +0000"
else
@@ -549,7 +549,6 @@ diff_file()
if ! [ -s "$new_file" ]
then
new_file=/dev/null
- new_hdr=/dev/null
[ -n "$QUILT_NO_DIFF_TIMESTAMPS" ] \
|| new_date=$'\t'"1970-01-01 00:00:00.000000000 +0000"
else
diff --git a/test/null-bug.test b/test/null-bug.test
new file mode 100644
index 0000000..324690a
--- /dev/null
+++ b/test/null-bug.test
@@ -0,0 +1,24 @@
+ $ mkdir d
+ $ cd d
+
+ $ echo file > file
+ $ quilt new remove.diff
+ > Patch patches/remove.diff is now on top
+
+ $ quilt add file
+ > File file added to patch patches/remove.diff
+
+ $ rm file
+ $ quilt ref -p0
+ > Refreshed patch patches/remove.diff
+
+ $ quilt pop -q
+ > Removing patch patches/remove.diff
+ > No patches applied
+
+ $ quilt push -q
+ > Applying patch patches/remove.diff
+ > Now at patch patches/remove.diff
+
+ $ cd ..
+ $ rm -r d