summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-09-22 11:48:33 +0000
committerAndreas Gruenbacher <agruen@suse.de>2004-09-22 11:48:33 +0000
commit518d019508cf05471be6b249d1e0f66961a8eb6d (patch)
tree36add8ccc8272c8af615dcc94992041328988b3a /scripts
parent117e66f40d01d34d4be2336029f4a55b5d51d762 (diff)
downloadquilt-518d019508cf05471be6b249d1e0f66961a8eb6d.tar.gz
- scripts/patchfns.in: set the dotglob option so that dot files
will show up in file globs as well. Bug reported by James Rowe. - Add a missing tab to the patch header of files that are removed. Bug reported by James Rowe. - Push command: Without -f or --leave-rejects, when applying a patch failed, the *.rej files were not removed properly. Change the code so that they won't be created in the working tree in the first place this case. - test/run script: Oops, the previouos commit was not the latest version. - Bump version to 0.36.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/apatch.in23
-rw-r--r--scripts/patchfns.in3
2 files changed, 18 insertions, 8 deletions
diff --git a/scripts/apatch.in b/scripts/apatch.in
index 6ab07b9..11f3739 100755
--- a/scripts/apatch.in
+++ b/scripts/apatch.in
@@ -47,16 +47,19 @@ apply_patch()
gzip -cd $patch_file \
| @PATCH@ $QUILT_PATCH_OPTS $(patch_args $patch) \
--backup --prefix="$QUILT_PC/$patch/" \
+ $no_reject_files \
-E $silent $force_apply 2>&1
elif [ "x${patch_file:(-4)}" = "x.bz2" ]
then
bzip2 -cd $patch_file \
| @PATCH@ $QUILT_PATCH_OPTS $(patch_args $patch) \
--backup --prefix="$QUILT_PC/$patch/" \
+ $no_reject_files \
-E $silent $force_apply 2>&1
else
@PATCH@ $QUILT_PATCH_OPTS $(patch_args $patch) \
--backup --prefix="$QUILT_PC/$patch/" \
+ $no_reject_files \
-E $silent $force_apply -i $patch_file 2>&1
fi
}
@@ -65,11 +68,6 @@ rollback_patch()
{
local patch=$1
- if [ -z "$opt_leave_rejects" ]
- then
- files_in_patch | @SED@ -e 's/$/\.rej/' | xargs rm -f
- fi
-
@LIB@/backup-files $silent_unless_verbose -r -B $QUILT_PC/$patch/ -
}
@@ -81,6 +79,13 @@ apatch()
printf $"Applying patch %s\n" "$(print_patch $patch)"
trap "interrupt $patch" SIGINT
+ no_reject_files=
+ if [ -z "$opt_leave_rejects" ]; then
+ local tmp="$(gen_tempfile)"
+ trap "rm -f $tmp" EXIT
+ no_reject_files="-r $tmp"
+ fi
+
output="$(apply_patch $patch)"
status=${PIPESTATUS[0]}
@@ -90,8 +95,12 @@ apatch()
then
# The reject files are removed in rollback_patch.
echo "$output" \
- | @SED@ -e \
-'s/-- saving rejects to file \(.\+\)\.rej/-- rejects in file \1/'
+ | @AWK@ '
+ /^patching file / { filename = substr($0, 15) }
+ { gsub(/-- saving rejects to file .*/,
+ "-- rejects in file " filename) }
+ { print }
+ '
elif [ -n "$output" ]
then
echo "$output"
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index 36f3d4f..5ce5c6d 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -22,6 +22,7 @@ DB_VERSION=2
: ${QUILT_PC:=.pc}
unset CDPATH
+shopt -s dotglob
if [ -e "$QUILTRC" ]
then
@@ -532,7 +533,7 @@ diff_file()
new_file=/dev/null
new_hdr=/dev/null
[ -n "$QUILT_NO_DIFF_TIMESTAMPS" ] \
- || new_date="1970-01-01 00:00:00.000000000 +0000"
+ || new_date=$'\t'"1970-01-01 00:00:00.000000000 +0000"
else
[ -n "$QUILT_NO_DIFF_TIMESTAMPS" ] \
|| new_date=$'\t'$(date +'%Y-%m-%d %H:%M:%S.%N %z' \