diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/apatch.in | 21 | ||||
-rw-r--r-- | scripts/patchfns.in | 11 | ||||
-rwxr-xr-x | scripts/rpatch.in | 14 |
3 files changed, 27 insertions, 19 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 diff --git a/scripts/patchfns.in b/scripts/patchfns.in index 15a5248..66755e5 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -64,8 +64,6 @@ dirname() patch_file_name() { - local patch=$1 - echo "$QUILT_PATCHES/$1" } @@ -601,7 +599,7 @@ patch_description() { eat = eat $0 "\n" next } { print eat $0 - eat="" } + eat = "" } ' $patch_file fi } @@ -699,7 +697,7 @@ version_check() { version="$(< $QUILT_PC/.version)" if [ "$version" -gt $DB_VERSION ] then - echo $"The quilt meta-data in this tree has version $version, but this version of quilt can only handle meta-data formats up to and including version $DB_VERSION. Please pop all the patches using the version of quilt used to push them before downgrading." >&2 + printf $"The quilt meta-data in this tree has version %s, but this version of quilt can only handle meta-data formats up to and including version %s. Please pop all the patches using the version of quilt used to push them before downgrading.\n" "$version" "$DB_VERSION" >&2 exit 1 elif [ "$version" = $DB_VERSION ] then @@ -709,6 +707,9 @@ version_check() { return 1 } +print_patch() { + echo -n "${QUILT_PATCHES_PREFIX:+$QUILT_PATCHES/}$1" +} # # If the working directory does not contain a $QUILT_PATCHES directory, @@ -761,7 +762,7 @@ DB="$QUILT_PC/applied-patches" if [ -z "$skip_version_check" ] && ! version_check then - echo $"The working tree was created by an older version of quilt. Please run 'quilt upgrade'." >&2 + prinf $"The working tree was created by an older version of quilt. Please run 'quilt upgrade'.\n" >&2 exit 1 fi ### Local Variables: diff --git a/scripts/rpatch.in b/scripts/rpatch.in index bbe988f..3282d1c 100755 --- a/scripts/rpatch.in +++ b/scripts/rpatch.in @@ -19,7 +19,7 @@ fi usage() { - echo $"Usage: $0 [-fRq] patchname" + printf $"Usage: $0 [-fRq] patchname\n" exit 1 } @@ -59,7 +59,7 @@ check_for_pending_changes() if ! rmdir $workdir || # note that this is racey... ! cp -rl $QUILT_PC/$patch $workdir/ then - echo $"Failed to copy files to temporary directory" + printf $"Failed to copy files to temporary directory\n" >&2 rm -rf $workdir return 1 fi @@ -82,7 +82,7 @@ check_for_pending_changes() then if ! [ -e $QUILT_PC/$patch ] then - echo $"Failed to patch temporary files" >&2 + printf $"Failed to patch temporary files\n" >&2 rm -rf $workdir return 1 fi @@ -97,7 +97,8 @@ check_for_pending_changes() if [ -s $remains ] then - echo $"Patch $patch does not remove cleanly (enforce with -f)." + printf $"Patch %s does not remove cleanly (enforce with -f)\n" \ + "$(print_patch $patch)" >&2 status=1 fi rm -f $remains @@ -119,7 +120,7 @@ rpatch() if [ $status -eq 0 ] then - echo $"Removing $patch" + printf $"Removing patch %s\n" "$(print_patch $patch)" rm -f "$QUILT_PC/$patch/.timestamp" @LIB@/backup-files $silent -r -B $QUILT_PC/$patch/ - status=$? @@ -175,7 +176,8 @@ patch=$1 top=$(top_patch) if [ -n "$top" -a -e $QUILT_PC/$top~refresh -a -z "$opt_force" ] then - echo $"The topmost patch $top needs to be refreshed first." + printf $"Patch %s needs to be refreshed first.\n" \ + "$(print_patch $top)" >&2 exit 1 fi |