aboutsummaryrefslogtreecommitdiff
path: root/bin/pkgpatch
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pkgpatch')
-rwxr-xr-xbin/pkgpatch14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/pkgpatch b/bin/pkgpatch
new file mode 100755
index 0000000..d59ea6a
--- /dev/null
+++ b/bin/pkgpatch
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# pkgpatch -- patch, saving original files
+
+move()
+{
+ 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 "$@"