When adding a new tool version, allow it to be EXPERIMENTAL.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Apr 18 17:32:55 2007 +0000 (2007-04-18)
changeset 43f3b4bb1e501b
parent 42 aacc012db6c4
child 44 1bfe65e14402
When adding a new tool version, allow it to be EXPERIMENTAL.
tools/addToolVersion.sh
     1.1 --- a/tools/addToolVersion.sh	Wed Apr 18 11:55:52 2007 +0000
     1.2 +++ b/tools/addToolVersion.sh	Wed Apr 18 17:32:55 2007 +0000
     1.3 @@ -9,6 +9,10 @@
     1.4    'tool' in one of:
     1.5      --gcc, --tcc, --binutils, --glibc, --uClibc, --linux, --cygwin
     1.6  
     1.7 +  Options:
     1.8 +    --experimental, -x
     1.9 +      mark the version as being experimental
    1.10 +
    1.11    Valid mandatory 'option' for tool==gcc is one of:
    1.12      --core, --final
    1.13  
    1.14 @@ -31,23 +35,25 @@
    1.15  CORE=
    1.16  FINAL=
    1.17  VERSION=
    1.18 +EXP=
    1.19  
    1.20  i=1
    1.21  while [ $i -le $# ]; do
    1.22      case "${!i}" in
    1.23 -        --gcc)          cat=CC;        tool=gcc;      tool_prefix=cc_;      tool_suffix=;;
    1.24 -#        --tcc)          cat=CC;        tool=tcc;      tool_prefix=cc_;      tool_suffix=;;
    1.25 -        --binutils)     cat=BINUTILS;  tool=binutils; tool_prefix=;         tool_suffix=;;
    1.26 -        --glibc)        cat=LIBC;      tool=glibc;    tool_prefix=libc_;    tool_suffix=;;
    1.27 -        --uClibc)       cat=LIBC;      tool=uClibc;   tool_prefix=libc_;    tool_suffix=;;
    1.28 -        --linux)        cat=KERNEL;    tool=linux;    tool_prefix=kernel_;;
    1.29 -#        --cygwin)       cat=KERNEL;    tool=cygwin;   tool_prefix=kernel_;;
    1.30 -        --core)         CORE=1;;
    1.31 -        --final)        FINAL=1;;
    1.32 -        --install)      tool_suffix=install;;
    1.33 -        --sanitised)    tool_suffix=sanitised;;
    1.34 -        --copy)         tool_suffix=copy;;
    1.35 -        -h|--help)      doHelp; exit 0;;
    1.36 +        --gcc)              cat=CC;        tool=gcc;      tool_prefix=cc_;      tool_suffix=;;
    1.37 +#        --tcc)              cat=CC;        tool=tcc;      tool_prefix=cc_;      tool_suffix=;;
    1.38 +        --binutils)         cat=BINUTILS;  tool=binutils; tool_prefix=;         tool_suffix=;;
    1.39 +        --glibc)            cat=LIBC;      tool=glibc;    tool_prefix=libc_;    tool_suffix=;;
    1.40 +        --uClibc)           cat=LIBC;      tool=uClibc;   tool_prefix=libc_;    tool_suffix=;;
    1.41 +        --linux)            cat=KERNEL;    tool=linux;    tool_prefix=kernel_;;
    1.42 +#        --cygwin)           cat=KERNEL;    tool=cygwin;   tool_prefix=kernel_;;
    1.43 +        --core)             CORE=1;;
    1.44 +        --final)            FINAL=1;;
    1.45 +        --install)          tool_suffix=install;;
    1.46 +        --sanitised)        tool_suffix=sanitised;;
    1.47 +        --copy)             tool_suffix=copy;;
    1.48 +        -x|--experimental)  EXP=1;;
    1.49 +        -h|--help)          doHelp; exit 0;;
    1.50          -*)             echo "Unknown option: \"${!i}\". (use -h/--help for help"; exit 1;;
    1.51          *)              VERSION="${VERSION} ${!i}";;
    1.52      esac
    1.53 @@ -65,22 +71,21 @@
    1.54  esac
    1.55  
    1.56  for ver in ${VERSION}; do
    1.57 +    unset DEP L1 L2 L3 L4 L5 FILE
    1.58  	v=`echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;'`
    1.59      if [ -n "${CORE}" ]; then
    1.60          L1="config ${cat}_CORE_V_${v}\n"
    1.61          L2="    bool\n"
    1.62          L3="    prompt \"${ver}\"\n"
    1.63 -        L4="    default \"${ver}\" if ${cat}_CORE_V_${v}"
    1.64 -        sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}"'\n\1/;
    1.65 -                      s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L4}"'\n\1/;' config/${tool_prefix}core_${tool}.in
    1.66 +        L5="    default \"${ver}\" if ${cat}_CORE_V_${v}"
    1.67 +        FILE="config/${tool_prefix}core_${tool}.in"
    1.68      fi
    1.69      if [ -n "${FINAL}" ]; then
    1.70          L1="config ${cat}_V_${v}\n"
    1.71          L2="    bool\n"
    1.72          L3="    prompt \"${ver}\"\n"
    1.73 -        L4="    default \"${ver}\" if ${cat}_V_${v}"
    1.74 -        sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}"'\n\1/;
    1.75 -                      s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L4}"'\n\1/;' config/${tool_prefix}${tool}.in
    1.76 +        L5="    default \"${ver}\" if ${cat}_V_${v}"
    1.77 +        FILE="config/${tool_prefix}${tool}.in"
    1.78      fi
    1.79      if [ "${cat}" = "KERNEL" ]; then
    1.80          TOOL_SUFFIX="`echo \"${tool_suffix}\" |tr [[:lower:]] [[:upper:]]`"
    1.81 @@ -88,14 +93,18 @@
    1.82          L2="    bool\n"
    1.83          L3="    prompt \"${ver}\"\n"
    1.84          # Extra versions are not necessary visible:
    1.85 -        case "${ver}" in
    1.86 -            *.*.*.*) L4="    depends on KERNEL_VERSION_SEE_EXTRAVERSION\n";;
    1.87 -            *)       L4=;;
    1.88 +        case "${tool_suffix},${ver}" in
    1.89 +            sanitised,*)    ;; # Sanitised headers always have an extra version
    1.90 +            *,*.*.*.*)      DEP="${DEP} && KERNEL_VERSION_SEE_EXTRAVERSION";;
    1.91          esac
    1.92 -        # Sanitised headers always have an extra version:
    1.93 -        [ "${tool_suffix}" = "sanitised" ] && L4=
    1.94          L5="    default \"${ver}\" if ${cat}_${TOOL_SUFFIX}_V_${v}"
    1.95 -        sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}"'\n\1/;
    1.96 -                      s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L5}"'\n\1/;' config/${tool_prefix}${tool}_headers_${tool_suffix}.in
    1.97 +        FILE="config/${tool_prefix}${tool}_headers_${tool_suffix}.in"
    1.98      fi
    1.99 +    [ -n "${EXP}" ] && DEP="${DEP} && EXPERIMENTAL"
   1.100 +    case "${DEP}" in
   1.101 +        "") ;;
   1.102 +        *)  L4="    depends on `echo \"${DEP}\" |sed -r -e 's/^ \\&\\& //; s/\\&/\\\\&/g;'`\n"
   1.103 +    esac
   1.104 +    sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}"'\n\1/;
   1.105 +                  s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L5}"'\n\1/;' "${FILE}"
   1.106  done