aboutsummaryrefslogtreecommitdiff
path: root/bin/pkgundo
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-26 22:37:51 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-26 22:37:51 +0200
commit6b773971fad1d4967cd0adf9548af261f970a2d2 (patch)
tree574b281361c38c92fd68759f11e7d0ce51de2bac /bin/pkgundo
parent763e138b3dc2c5b68aa7edf8d3e9e520380495d1 (diff)
downloadpatches-6b773971fad1d4967cd0adf9548af261f970a2d2.tar.gz
Add pkgpatchex script
Diffstat (limited to 'bin/pkgundo')
-rwxr-xr-xbin/pkgundo8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/pkgundo b/bin/pkgundo
index 9f3ad25..171261f 100755
--- a/bin/pkgundo
+++ b/bin/pkgundo
@@ -2,11 +2,11 @@
# pkgundo -- restore original files
-[ $# -eq 0 ] && { echo "usage: ${0##*/} orig ..." 2>&1; exit 1; }
+[ $# -eq 0 ] && { echo "usage: ${0##*/} file ..." 2>&1; exit 1; }
-n=
+n=0
for orig in "$@"; do
- : $((n++))
- mv "$orig" "${orig%.orig}"
+ orig=${orig%.orig}.orig
+ mv "$orig" "${orig%.orig}" && : $((n++))
done
echo "${0##*/}: moved $n files" 2>&1