summaryrefslogtreecommitdiff
path: root/tools/addToolVersion.sh
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-04-18 17:32:55 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-04-18 17:32:55 (GMT)
commitab7e22eb206bc6daf2cb978ae4f0a4f92db7cdfc (patch)
treef07de577d6d22942310fa108a16a458e66358556 /tools/addToolVersion.sh
parent66bc1c8896b7b0ff925758abb7f7c76a408e2ba8 (diff)
When adding a new tool version, allow it to be EXPERIMENTAL.
Diffstat (limited to 'tools/addToolVersion.sh')
-rwxr-xr-xtools/addToolVersion.sh61
1 files changed, 35 insertions, 26 deletions
diff --git a/tools/addToolVersion.sh b/tools/addToolVersion.sh
index ace6bb7..6ab2735 100755
--- a/tools/addToolVersion.sh
+++ b/tools/addToolVersion.sh
@@ -9,6 +9,10 @@ Usage: ${myname} <tool> [option] <version>
'tool' in one of:
--gcc, --tcc, --binutils, --glibc, --uClibc, --linux, --cygwin
+ Options:
+ --experimental, -x
+ mark the version as being experimental
+
Valid mandatory 'option' for tool==gcc is one of:
--core, --final
@@ -31,23 +35,25 @@ tool_prefix=
CORE=
FINAL=
VERSION=
+EXP=
i=1
while [ $i -le $# ]; do
case "${!i}" in
- --gcc) cat=CC; tool=gcc; tool_prefix=cc_; tool_suffix=;;
-# --tcc) cat=CC; tool=tcc; tool_prefix=cc_; tool_suffix=;;
- --binutils) cat=BINUTILS; tool=binutils; tool_prefix=; tool_suffix=;;
- --glibc) cat=LIBC; tool=glibc; tool_prefix=libc_; tool_suffix=;;
- --uClibc) cat=LIBC; tool=uClibc; tool_prefix=libc_; tool_suffix=;;
- --linux) cat=KERNEL; tool=linux; tool_prefix=kernel_;;
-# --cygwin) cat=KERNEL; tool=cygwin; tool_prefix=kernel_;;
- --core) CORE=1;;
- --final) FINAL=1;;
- --install) tool_suffix=install;;
- --sanitised) tool_suffix=sanitised;;
- --copy) tool_suffix=copy;;
- -h|--help) doHelp; exit 0;;
+ --gcc) cat=CC; tool=gcc; tool_prefix=cc_; tool_suffix=;;
+# --tcc) cat=CC; tool=tcc; tool_prefix=cc_; tool_suffix=;;
+ --binutils) cat=BINUTILS; tool=binutils; tool_prefix=; tool_suffix=;;
+ --glibc) cat=LIBC; tool=glibc; tool_prefix=libc_; tool_suffix=;;
+ --uClibc) cat=LIBC; tool=uClibc; tool_prefix=libc_; tool_suffix=;;
+ --linux) cat=KERNEL; tool=linux; tool_prefix=kernel_;;
+# --cygwin) cat=KERNEL; tool=cygwin; tool_prefix=kernel_;;
+ --core) CORE=1;;
+ --final) FINAL=1;;
+ --install) tool_suffix=install;;
+ --sanitised) tool_suffix=sanitised;;
+ --copy) tool_suffix=copy;;
+ -x|--experimental) EXP=1;;
+ -h|--help) doHelp; exit 0;;
-*) echo "Unknown option: \"${!i}\". (use -h/--help for help"; exit 1;;
*) VERSION="${VERSION} ${!i}";;
esac
@@ -65,22 +71,21 @@ case "${cat}" in
esac
for ver in ${VERSION}; do
+ unset DEP L1 L2 L3 L4 L5 FILE
v=`echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;'`
if [ -n "${CORE}" ]; then
L1="config ${cat}_CORE_V_${v}\n"
L2=" bool\n"
L3=" prompt \"${ver}\"\n"
- L4=" default \"${ver}\" if ${cat}_CORE_V_${v}"
- sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}"'\n\1/;
- s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L4}"'\n\1/;' config/${tool_prefix}core_${tool}.in
+ L5=" default \"${ver}\" if ${cat}_CORE_V_${v}"
+ FILE="config/${tool_prefix}core_${tool}.in"
fi
if [ -n "${FINAL}" ]; then
L1="config ${cat}_V_${v}\n"
L2=" bool\n"
L3=" prompt \"${ver}\"\n"
- L4=" default \"${ver}\" if ${cat}_V_${v}"
- sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}"'\n\1/;
- s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L4}"'\n\1/;' config/${tool_prefix}${tool}.in
+ L5=" default \"${ver}\" if ${cat}_V_${v}"
+ FILE="config/${tool_prefix}${tool}.in"
fi
if [ "${cat}" = "KERNEL" ]; then
TOOL_SUFFIX="`echo \"${tool_suffix}\" |tr [[:lower:]] [[:upper:]]`"
@@ -88,14 +93,18 @@ for ver in ${VERSION}; do
L2=" bool\n"
L3=" prompt \"${ver}\"\n"
# Extra versions are not necessary visible:
- case "${ver}" in
- *.*.*.*) L4=" depends on KERNEL_VERSION_SEE_EXTRAVERSION\n";;
- *) L4=;;
+ case "${tool_suffix},${ver}" in
+ sanitised,*) ;; # Sanitised headers always have an extra version
+ *,*.*.*.*) DEP="${DEP} && KERNEL_VERSION_SEE_EXTRAVERSION";;
esac
- # Sanitised headers always have an extra version:
- [ "${tool_suffix}" = "sanitised" ] && L4=
L5=" default \"${ver}\" if ${cat}_${TOOL_SUFFIX}_V_${v}"
- sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}"'\n\1/;
- s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L5}"'\n\1/;' config/${tool_prefix}${tool}_headers_${tool_suffix}.in
+ FILE="config/${tool_prefix}${tool}_headers_${tool_suffix}.in"
fi
+ [ -n "${EXP}" ] && DEP="${DEP} && EXPERIMENTAL"
+ case "${DEP}" in
+ "") ;;
+ *) L4=" depends on `echo \"${DEP}\" |sed -r -e 's/^ \\&\\& //; s/\\&/\\\\&/g;'`\n"
+ esac
+ sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}"'\n\1/;
+ s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L5}"'\n\1/;' "${FILE}"
done