scripts/patch-renumber.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 03 21:10:15 2009 +0000 (2009-05-03)
changeset 1318 5416f4ba36bf
parent 1175 417b32da90bf
child 1577 c774b2cc7863
permissions -rwxr-xr-x
Prepare for gcc-4.4:
- add 'companion_libs/' to hold all libraries needed to build gcc-4.3+ and gcc-4.4+
- move GMP & MPFR to 'companion_libs/'

-------- diffstat follows --------
/trunk/scripts/build/gmp.sh | 85 0 85 0 ----------------------------
/trunk/scripts/build/mpfr.sh | 139 0 139 0 ---------------------------------------------
/trunk/scripts/addToolVersion.sh | 4 2 2 0
/trunk/scripts/crosstool-NG.sh.in | 4 2 2 0
/trunk/config/companion_libs.in | 17 10 7 0 +++---
/trunk/config/gmp_mpfr/gmp.in | 32 0 32 0 ----------
/trunk/config/gmp_mpfr/mpfr.in | 42 0 42 0 --------------
/trunk/config/config.in | 2 1 1 0
/trunk/config/gmp_mpfr.in | 35 0 35 0 -----------
9 files changed, 15 insertions(+), 345 deletions(-)
     1 #!/bin/sh
     2 # Yes, this intends to be a true POSIX script file.
     3 set -e
     4 
     5 myname="$0"
     6 
     7 # Parse the tools' paths configuration
     8 . "paths.mk"
     9 
    10 doUsage() {
    11   cat <<_EOF_
    12 Usage: ${myname} <dir> <base> <inc>
    13     Will renumber all patches found in <dir>, starting at <base>, and with
    14     an increment of <inc>
    15     Eg.: patch-renumber patches/gcc/4.3.1 100 10
    16 _EOF_
    17 }
    18 
    19 [ $# -eq 3 ] || { doUsage; exit 1; }
    20 [ -d "${1}" ] || { doUsage; exit 1; }
    21 
    22 dir="${1}"
    23 cpt="${2}"
    24 inc="${3}"
    25 
    26 case "$(LC_ALL=C svnversion "${dir}" 2>/dev/null)" in
    27     exported)   CMD="mv -v";;
    28     *)          CMD="svn mv";;
    29 esac
    30 
    31 for p in "${dir}"/*.patch; do
    32     [ -e "${p}" ] || { echo "No such file '${p}'"; exit 1; }
    33     newname="$(printf "%03d-%s"                                 \
    34                       "${cpt}"                                  \
    35                       "$(basename "${p}"                        \
    36                         |"${sed}" -r -e 's/^[[:digit:]]+[-_]//' \
    37                        )"                                       \
    38               )"
    39     [ "${p}" = "${dir}/${newname}" ] || ${CMD} "${p}" "${dir}/${newname}"
    40     cpt=$((cpt+inc))
    41 done