summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2003-10-29 16:20:32 +0000
committerAndreas Gruenbacher <agruen@suse.de>2003-10-29 16:20:32 +0000
commit4439b9c03e23f51e6d28eadac44089fba0b28856 (patch)
treead6bc7d9f27a6942e78176795b1d3e79ba82a867
parent0649767d2c7f6cb6b5791564b6623c132fd674fd (diff)
downloadquilt-4439b9c03e23f51e6d28eadac44089fba0b28856.tar.gz
- If a patch does not apply cleanly and `quilt push' removes
rejects files it GNU patch left behind, change the output from ``saving rejects to file x.rej'' to ``rejects in file x''.
-rw-r--r--TODO6
-rw-r--r--quilt.changes7
-rwxr-xr-xscripts/apatch.in22
3 files changed, 31 insertions, 4 deletions
diff --git a/TODO b/TODO
index 66a9900..cd3097b 100644
--- a/TODO
+++ b/TODO
@@ -78,3 +78,9 @@ apatch:
inject the patch in its proper position in applied-patches.
Needs to check if any of the files in the patch are touched by
later patches.
+
+quilt diff:
+
+ - The number of contetx lines cannot be overridden in QUILT_DIFF_OPTS:
+ GNU diff uses three context lines as soon as -u or -U3 is on the
+ command line, no matter which order of arguments.
diff --git a/quilt.changes b/quilt.changes
index 6e285d6..11db26e 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Wed Oct 29 17:19:24 CET 2003 - agruen@suse.de
+
+- If a patch does not apply cleanly and `quilt push' removes
+ rejects files it GNU patch left behind, change the output from
+ ``saving rejects to file x.rej'' to ``rejects in file x''.
+
+-------------------------------------------------------------------
Tue Oct 28 14:51:07 CET 2003 - agruen@suse.de
- Remove .pc/*/.pc files, and adjust various scripts accordingly.
diff --git a/scripts/apatch.in b/scripts/apatch.in
index 69f327f..511f878 100755
--- a/scripts/apatch.in
+++ b/scripts/apatch.in
@@ -47,7 +47,7 @@ interrupt()
apply_patch()
{
local patch=$1
- local patch_file=$(patch_file_name $patch)
+ local patch_file=$(patch_file_name $patch) output
if ! [ -s $patch_file ]
then
@@ -57,18 +57,31 @@ apply_patch()
if [ "x${patch_file:(-3)}" = "x.gz" ]
then
+ output="$(
gzip -cd $patch_file \
| @PATCH@ $(patch_args $patch) --backup --prefix=".pc/$patch/" \
- -E $silent $force_apply
+ -E $silent $force_apply 2>&1 )"
elif [ "x${patch_file:(-4)}" = "x.bz2" ]
then
+ output="$(
bzip2 -cd $patch_file \
| @PATCH@ $(patch_args $patch) --backup --prefix=".pc/$patch/" \
- -E $silent $force_apply
+ -E $silent $force_apply 2>&1 )"
else
+ output="$(
@PATCH@ $(patch_args $patch) --backup --prefix=".pc/$patch/" \
- -E $silent -i $patch_file $force_apply
+ -E $silent -i $patch_file $force_apply 2>&1 )"
fi
+ status=${PIPESTATUS[0]}
+ if [ $status -ne 0 -a -z "$opt_leave_rejects" ]
+ then
+ # The reject files are removed in rollback_patch.
+ echo "$output" \
+ | sed -e 's/-- saving rejects to file \(.\+\)\.rej/-- rejects in file \1/'
+ else
+ echo "$output"
+ fi
+ return $status
}
apatch()
@@ -152,6 +165,7 @@ fi
[ -n "$opt_quiet" ] && silent=-s
[ -z "$opt_verbose" ] && silent_unless_verbose=-s
[ -z "$opt_interactive" ] && force_apply=-f
+[ -n "$opt_force" ] && opt_leave_rejects=1
patch=$(stripit $1)