scripts/patch-renumber.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jan 03 21:11:41 2009 +0000 (2009-01-03)
changeset 1112 c72aecd1a9ef
parent 756 63d3f428f302
child 1175 417b32da90bf
permissions -rwxr-xr-x
Get rid of all stuff related to building a /delivery' traball:
- building a delivery tarball has long been broken (since crostool-Ng is installable)
- get rid of implied do_print_filename, that can be mis-leading now tarballs can not be built

/trunk/scripts/build/kernel/bare-metal.sh | 4 0 4 0 ----
/trunk/scripts/build/kernel/linux.sh | 4 0 4 0 ----
/trunk/scripts/build/tools/000-template.sh | 11 0 11 0 -----------
/trunk/scripts/build/tools/100-libelf.sh | 4 0 4 0 ----
/trunk/scripts/build/tools/200-sstrip.sh | 11 1 10 0 +----------
/trunk/scripts/build/binutils.sh | 4 0 4 0 ----
/trunk/scripts/build/cc/gcc.sh | 5 0 5 0 -----
/trunk/scripts/build/debug/000-template.sh | 11 0 11 0 -----------
/trunk/scripts/build/debug/100-dmalloc.sh | 4 0 4 0 ----
/trunk/scripts/build/debug/400-ltrace.sh | 4 0 4 0 ----
/trunk/scripts/build/debug/300-gdb.sh | 7 0 7 0 -------
/trunk/scripts/build/debug/500-strace.sh | 4 0 4 0 ----
/trunk/scripts/build/debug/200-duma.sh | 4 0 4 0 ----
/trunk/scripts/build/libc/none.sh | 5 0 5 0 -----
/trunk/scripts/build/libc/glibc.sh | 10 0 10 0 ----------
/trunk/scripts/build/libc/uClibc.sh | 6 0 6 0 ------
/trunk/scripts/build/libc/eglibc.sh | 10 0 10 0 ----------
/trunk/scripts/build/gmp.sh | 6 0 6 0 ------
/trunk/scripts/build/mpfr.sh | 6 0 6 0 ------
/trunk/docs/overview.txt | 9 0 9 0 ---------
20 files changed, 1 insertion(+), 128 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