mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-02-20 09:06:19 +00:00
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(-)
This commit is contained in:
parent
97b23feb3a
commit
7fc16eff80
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user