scripts/patch-renumber.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jan 26 22:43:08 2009 +0000 (2009-01-26)
changeset 1156 b8e4a98bbdf3
parent 756 63d3f428f302
child 1175 417b32da90bf
permissions -rwxr-xr-x
Finally used the discovered paths from ./configure in scripts/crosstool-NG.sh:
- fix Makefile to really, really not used built-in rules and variables
- have scripts/crosstool-NG.sh generated from scripts/crosstool-NG.sh.in
- create a bin-overide directory ( in ${CT_WORK_DIR}/bin ) that contains shell wrappers to the actual discovered tools

/trunk/scripts/crosstool-NG.sh.in | 27 23 4 0 +++++++++++++++++++++---
/trunk/Makefile.in | 50 48 2 0 +++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 71 insertions(+), 6 deletions(-)
     1 #!/bin/sh
     2 # Yes, this intends to be a true POSIX script file.
     3 
     4 myname="$0"
     5 
     6 doUsage() {
     7   cat <<_EOF_
     8 Usage: ${myname} <dir> <base> <inc>
     9     Will renumber all patches found in <dir>, starting at <base>, and with
    10     an increment of <inc>
    11     Eg.: patch-renumber patches/gcc/4.3.1 100 10
    12 _EOF_
    13 }
    14 
    15 [ $# -eq 3 ] || { doUsage; exit 1; }
    16 [ -d "${1}" ] || { doUsage; exit 1; }
    17 
    18 dir="${1}"
    19 cpt="${2}"
    20 inc="${3}"
    21 
    22 case $(LC_ALL=C svnversion 2>/dev/null) in
    23     exported)   CMD="mv -v";;
    24     *)          CMD="svn mv";;
    25 esac
    26 
    27 for p in "${dir}"/*.patch; do
    28     [ -e "${p}" ] || { echo "No such file '${p}'"; exit 1; }
    29     newname="$(printf "%03d" ${cpt})-$(basename "${p}" |sed -r -e 's/^[[:digit:]]{3}-//')"
    30     [ "${p}" = "${dir}/${newname}" ] || ${CMD} "${p}" "${dir}/${newname}"
    31     cpt=$((cpt+inc))
    32 done