summaryrefslogtreecommitdiffstats
path: root/scripts/apatch.in
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-07-09 07:26:21 +0000
committerAndreas Gruenbacher <agruen@suse.de>2004-07-09 07:26:21 +0000
commite7bb642fdbcfa9bb1d7265781f56d89e398f90b9 (patch)
tree1ad9d16ce37e504ba72f9315c94ca9eb95597133 /scripts/apatch.in
parentc871d820f8f00819613068aa77cb00d89e4508af (diff)
downloadquilt-e7bb642fdbcfa9bb1d7265781f56d89e398f90b9.tar.gz
- Switch from echo to printf for all translations: This is more
stable than having expansions in messages that might change independent of the message. - Add print_patch function and always use it when printing patch names. Remove -n options from various scripts and use a global switch QUILT_PATCHES_PREFIX in .quiltrc to decide between patch names with and without directory prefix. Depending on user experience this switch may eventually go away. - Add --diffstat option to refresh command: If given, this option inserts diffstat statistics at the end of the patch header, or refreshes the existing diffstat output. No special tags in the path file (%diffstat or the like) are needed. - Minor fix inserting changelog into RPM specfile.
Diffstat (limited to 'scripts/apatch.in')
-rwxr-xr-xscripts/apatch.in21
1 files changed, 13 insertions, 8 deletions
diff --git a/scripts/apatch.in b/scripts/apatch.in
index 38235cc..07009e7 100755
--- a/scripts/apatch.in
+++ b/scripts/apatch.in
@@ -19,14 +19,15 @@ fi
usage()
{
- echo $"Usage: $0 [-fqv] patchname"
+ printf $"Usage: $0 [-fqv] patchname\n"
exit 1
}
interrupt()
{
rollback_patch $1
- echo $"Interrupted by user; patch $patch was not applied."
+ printf $"Interrupted by user; patch %s was not applied.\n" \
+ "$(print_patch $patch)" >&2
exit 1
}
@@ -37,7 +38,7 @@ apply_patch()
if ! [ -s $patch_file ]
then
- echo $"Patch file $patch_file appears to be empty"
+ printf $"Patch %s appears to be empty\n" "$patch_file"
return 0
fi
@@ -77,7 +78,7 @@ apatch()
local patch=$1
local file status
- echo $"Applying $patch"
+ printf $"Applying patch %s\n" "$(print_patch $patch)"
trap "interrupt $patch" SIGINT
output="$(apply_patch $patch)"
@@ -113,14 +114,17 @@ apatch()
if [ "$(shopt -s nullglob ; echo $QUILT_PC/$patch/*)" = "" ]
then
- echo $"Patch $patch appears to be empty, applied"
+ printf $"Patch %s appears to be empty, applied\n" \
+ "$(print_patch $patch)"
elif [ $status -ne 0 ]
then
- echo $"Applied $patch (forced; needs refresh)"
+ printf $"Applied patch %s (forced; needs refresh)\n" \
+ "$(print_patch $patch)"
fi
else
rollback_patch $patch
- echo $"Patch $patch does not apply (enforce with -f)"
+ printf $"Patch %s does not apply (enforce with -f)\n" \
+ "$(print_patch $patch)"
status=1
fi
trap - SIGINT
@@ -177,7 +181,8 @@ patch=$1
top=$(top_patch)
if [ -n "$top" -a -e $QUILT_PC/$top~refresh ]
then
- echo $"The topmost patch $top needs to be refreshed first."
+ printf $"The topmost patch %s needs to be refreshed first.\n" \
+ "$(print_patch $top)"
exit 1
fi