tools/patch-renumber.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Oct 15 21:29:56 2008 +0000 (2008-10-15)
changeset 940 f0f9ba3f98f2
permissions -rwxr-xr-x
Cheesy kconfig stuff:
- silent/quiet/verbose build:
- ct-ng by default only prints quit messages, such as "CC xxx",
- if using V=0, nothing is printed,
- if using V=1, the full command lines are printed,
- other values are indeterminate,
- should help in debugging the kconfig stuff;
- complete kconfig/{,m}conf generation:
- fully dynamic dependencies on source files,
- compilation of .c into .o, then linking (instead of direct linking),
- VPATH usage when not --local;
Typo + a coment moved.

/trunk/kconfig/kconfig.mk | 140 87 53 0 +++++++++++++++++++++++++++++++++--------------------
/trunk/tools/tools.mk | 12 6 6 0 ++--
/trunk/steps.mk | 6 3 3 0 +-
/trunk/samples/samples.mk | 30 15 15 0 +++++-----
/trunk/ct-ng.in | 40 28 12 0 +++++++++++----
5 files changed, 139 insertions(+), 89 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