Add D.U.M.A., the Electric Fence successor.
3 # Adds a new version to one of the toolchain component
8 Usage: ${myname} <tool> [option] <version>
10 --gcc, --binutils, --glibc, --uClibc, --linux,
11 --gdb, --dmalloc, --duma
13 Valid options for all tools:
15 mark the version as being experimental
18 mark the version as being obsolete
20 Valid mandatory 'option' for tool==gcc is one and only one of:
23 Valid mandatory 'option' for tool==linux is one and only one of:
24 --install, --sanitised, --copy
26 'version' is a valid version for the specified tool.
29 add version 2.6.19.2 to linux kernel install method:
30 ${myname} --linux --install 2.6.19.2
32 add versions 2.3.5 and 2.3.6 to glibc:
33 ${myname} --glibc 2.3.5 2.3.6
48 while [ $i -le $# ]; do
51 --gcc) cat=CC; tool=gcc; tool_prefix=cc_; tool_suffix=;;
52 --binutils) cat=BINUTILS; tool=binutils; tool_prefix=; tool_suffix=;;
53 --glibc) cat=LIBC; tool=glibc; tool_prefix=libc_; tool_suffix=;;
54 --uClibc) cat=LIBC; tool=uClibc; tool_prefix=libc_; tool_suffix=;;
55 --linux) cat=KERNEL; tool=linux; tool_prefix=kernel_; tool_suffix=;;
56 --gdb) cat=GDB; tool=gdb; tool_prefix=debug/ tool_suffix=;;
57 --dmalloc) cat=DMALLOC; tool=dmalloc; tool_prefix=debug/ tool_suffix=;;
58 --duma) cat=DUMA; tool=duma; tool_prefix=debug/ tool_suffix=;;
60 -x|--experimental) EXP=1; OBS=;;
61 -o|--obsolete) OBS=1; EXP=;;
62 --core) CORE=1; FINAL=;;
63 --final) FINAL=1; CORE=;;
64 --install) tool_suffix=install;;
65 --sanitised) tool_suffix=sanitised;;
66 --copy) tool_suffix=copy;;
68 -h|--help) doHelp; exit 0;;
69 -*) echo "Unknown option: \"${!i}\". (use -h/--help for help"; exit 1;;
70 *) VERSION="${VERSION} ${!i}";;
75 [ -n "${tool}" -o -n "${VERSION}" ] || { doHelp; exit 1; }
78 CC) [ -z "${CORE}" -a -z "${FINAL}" ] && { doHelp; exit 1; };;
79 KERNEL) unset FINAL CORE
80 [ -z "${tool_suffix}" ] && { doHelp; exit 1; }
86 [ -n "${CORE}" ] && MIDDLE_V="_CORE" && MIDDLE_F="core_"
87 for ver in ${VERSION}; do
88 unset DEP L1 L2 L3 L4 L5 FILE
89 v=`echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;'`
90 if [ "${cat}" = "KERNEL" ]; then
91 TOOL_SUFFIX="`echo \"${tool_suffix}\" |tr [[:lower:]] [[:upper:]]`"
92 L1="config ${cat}_${TOOL_SUFFIX}_V_${v}\n"
94 L3=" prompt \"${ver}\"\n"
95 # Extra versions are not necessary visible:
96 case "${tool_suffix},${ver}" in
97 sanitised,*) ;; # Sanitised headers always have an extra version
98 *,*.*.*.*) DEP="${DEP} && KERNEL_VERSION_SEE_EXTRAVERSION";;
100 L5=" default \"${ver}\" if ${cat}_${TOOL_SUFFIX}_V_${v}"
101 FILE="config/${tool_prefix}${tool}_headers_${tool_suffix}.in"
103 L1="config ${cat}${MIDDLE_V}_V_${v}\n"
105 L3=" prompt \"${ver}\"\n"
106 L5=" default \"${ver}\" if ${cat}${MIDDLE_V}_V_${v}"
107 FILE="config/${tool_prefix}${MIDDLE_F}${tool}.in"
109 [ -n "${EXP}" ] && DEP="${DEP} && EXPERIMENTAL"
110 [ -n "${OBS}" ] && DEP="${DEP} && OBSOLETE"
113 *) L4=" depends on `echo \"${DEP}\" |sed -r -e 's/^ \\&\\& //; s/\\&/\\\\&/g;'`\n"
115 sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}"'\n\1/;
116 s/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L5}"'\n\1/;' "${FILE}"