diff options
Diffstat (limited to 'pkgpatch')
-rwxr-xr-x | pkgpatch | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -2,12 +2,14 @@ # pkgpatch -- patch but don't overwrite original files -for orig in *.orig; do - mv -i "$orig" "${orig%.orig}".~1~ -done - +move() +{ + echo "${0##*/}: Renaming *.$1 to *.$2..." 1>&2 + for orig in *.$1; do + mv -i "$orig" "${orig%.$1}".$2 + done +} + +move orig ~1~ +trap 'move ~1~ orig; trap -' INT QUIT TERM EXIT patch -Vt -F3 "$@" - -for orig in *.~1~; do - mv -i "$orig" "${orig%.~1~}".orig -done |