summaryrefslogtreecommitdiff
path: root/scripts/patch-renumber.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/patch-renumber.sh')
-rwxr-xr-xscripts/patch-renumber.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/patch-renumber.sh b/scripts/patch-renumber.sh
index f46c064..6837043 100755
--- a/scripts/patch-renumber.sh
+++ b/scripts/patch-renumber.sh
@@ -1,8 +1,12 @@
#!/bin/sh
# Yes, this intends to be a true POSIX script file.
+set -e
myname="$0"
+# Parse the tools' paths configuration
+. "paths.mk"
+
doUsage() {
cat <<_EOF_
Usage: ${myname} <dir> <base> <inc>
@@ -26,7 +30,7 @@ esac
for p in "${dir}"/*.patch; do
[ -e "${p}" ] || { echo "No such file '${p}'"; exit 1; }
- newname="$(printf "%03d" ${cpt})-$(basename "${p}" |sed -r -e 's/^[[:digit:]]{3}-//')"
+ newname="$(printf "%03d" ${cpt})-$(basename "${p}" |"${sed}" -r -e 's/^[[:digit:]]{3}-//')"
[ "${p}" = "${dir}/${newname}" ] || ${CMD} "${p}" "${dir}/${newname}"
cpt=$((cpt+inc))
done