summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-02-01 23:15:59 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-02-01 23:15:59 (GMT)
commit7fc16eff80dc041ce00349b150352cf51607c453 (patch)
treefd7d03a0a322258aef268ac66cfb0340b66a927c /scripts
parent97b23feb3aa994191eb1226b55f3c8f286c78adb (diff)
Fix patch-renumber:
- look at the patch directory when using svnversion, not at current directory - some code beautification. /trunk/scripts/patch-renumber.sh | 9 7 2 0 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/patch-renumber.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/patch-renumber.sh b/scripts/patch-renumber.sh
index 6837043..f670b90 100755
--- a/scripts/patch-renumber.sh
+++ b/scripts/patch-renumber.sh
@@ -23,14 +23,19 @@ dir="${1}"
cpt="${2}"
inc="${3}"
-case $(LC_ALL=C svnversion 2>/dev/null) in
+case "$(LC_ALL=C svnversion "${dir}" 2>/dev/null)" in
exported) CMD="mv -v";;
*) CMD="svn mv";;
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-%s" \
+ "${cpt}" \
+ "$(basename "${p}" \
+ |"${sed}" -r -e 's/^[[:digit:]]+[-_]//' \
+ )" \
+ )"
[ "${p}" = "${dir}/${newname}" ] || ${CMD} "${p}" "${dir}/${newname}"
cpt=$((cpt+inc))
done