scripts/patch-renumber.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed May 20 20:13:13 2009 +0000 (2009-05-20)
changeset 1345 27fec561af53
parent 1175 417b32da90bf
child 1577 c774b2cc7863
permissions -rwxr-xr-x
Merge the uClinux/noMMU stuff back to /trunk:
- merge Linux and uClinux back to a single kernel
- add ARCH_USE_MMU and acquainted config options that
architectures can auto-select
- make binutils and elf2flt two "Binary utilities" that
go in a single common sub-{menu,directory} structure

-------- diffstat follows --------
/trunk/scripts/build/kernel/uclinux.sh | 2 0 2 0 -
/trunk/scripts/build/kernel/linux.sh | 206 204 2 0 +++++++++++++++++++++++++++++
/trunk/scripts/build/kernel/linux-common.sh | 198 0 198 0 ----------------------------
/trunk/scripts/build/binutils.sh | 232 0 232 0 --------------------------------
/trunk/scripts/build/elf2flt.sh | 150 0 150 0 ---------------------
/trunk/scripts/crosstool-NG.sh.in | 6 4 2 0 +
/trunk/config/kernel/linux.in | 249 249 0 0 +++++++++++++++++++++++++++++++++++
/trunk/config/kernel/linux.in-common | 252 0 252 0 -----------------------------------
/trunk/config/kernel/uclinux.in | 21 0 21 0 ---
/trunk/config/target.in | 23 22 1 0 +++
/trunk/config/elf2flt.in | 49 0 49 0 -------
/trunk/config/libc/glibc.in | 2 1 1 0
/trunk/config/libc/eglibc.in | 2 1 1 0
/trunk/config/config.in | 1 0 1 0 -
/trunk/config/arch/sh.in | 1 1 0 0 +
/trunk/config/arch/arm.in | 2 1 1 0
/trunk/config/arch/powerpc.in | 1 1 0 0 +
/trunk/config/arch/ia64.in | 1 1 0 0 +
/trunk/config/arch/alpha.in | 1 1 0 0 +
/trunk/config/arch/x86.in | 1 1 0 0 +
/trunk/config/arch/mips.in | 1 1 0 0 +
/trunk/config/arch/powerpc64.in | 1 1 0 0 +
22 files changed, 489 insertions(+), 913 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