diff options
-rwxr-xr-x | bin/pkgdiffex | 6 | ||||
-rwxr-xr-x | bin/pkgpatchex | 7 | ||||
-rwxr-xr-x | bin/pkgundo | 8 |
3 files changed, 13 insertions, 8 deletions
diff --git a/bin/pkgdiffex b/bin/pkgdiffex index d2fea2b..9ff0585 100755 --- a/bin/pkgdiffex +++ b/bin/pkgdiffex @@ -3,7 +3,7 @@ # pkgdiffex -- diff files against existing patches if [ $# -eq 0 ]; then - echo "usage: ${0##*/} file [...]" 1>&2 + echo "usage: ${0##*/} file ..." 1>&2 exit 1 fi @@ -25,9 +25,7 @@ for o in "$@"; do cp "$o" "${o%.orig}" # f.orig +> f done -ls "$(whereispatch -i)"/patch-* | while read -r patch; do - pkgpatch <$patch -done +pkgpatchex for o in "$@"; do mv "${o%.orig}" "$o" # f -> f.orig diff --git a/bin/pkgpatchex b/bin/pkgpatchex new file mode 100755 index 0000000..c475a4b --- /dev/null +++ b/bin/pkgpatchex @@ -0,0 +1,7 @@ +#!/bin/sh + +# pkgpatchall -- apply all patches + +ls "$(whereispatch -i)"/patch-* | while read -r patch; do + pkgpatch <"$patch" +done 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 |