scripts: remove . from $PATH
Add CT_SanitizePath function which removes entries referring to ., /tmp
and non-existing directories from $PATH, and call it early in the
build script.
If . is in PATH, gcc-4.4.4 build breaks:
[ALL ] checking what assembler to use...
/tmp/build/targets/arm-unknown-linux-uclibcgnueabi/build/gcc-core-static/arm-unknown-linux-uclibcgnueabi/bin/as
...
[ALL ] config.status: creating as
i.e. "as" is supposed to be the arm-unknown-linux-uclibcgnueabi cross assembler,
but config.status creates a local "as" script which is calling the
host assembler.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
[Yann E. MORIN: style fixes + explanations]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 20dd8cef1c8adff0aa3e78ae6d7acfbc45ed5a83)
5 if [ -z "${repos}" -o ! -d "${repos}" -o -z "${pdir}" -o ! -d "${pdir}" ];then
6 printf "Usage: ${0##*/} <repos_dir> <patch_dir>\n"
10 pdir="$( cd "${pdir}"; pwd)"
11 version="$( echo "${pdir}" |sed -r -e 's,.*/([^/]+)/*$,\1,' )"
12 branch="${version%.*}"
13 n=$( ls -1 "${pdir}" 2>/dev/null |wc -l )
15 r1="$( hg -R "${repos}" log -b "${branch}" \
22 $0~/^summary:[[:space:]]+'"${branch}: (bump|update) version to ${version}\+hg"'$/ {
23 printf( "%d\n", prev );
29 hg -R "${repos}" log -b "${branch}" -r "${r1}:tip" --template '{rev}\n' \
31 p="$( printf "%03d" ${i} )"
33 if [ $( ls -1 "${pdir}/${p}-"*.patch 2>/dev/null |wc -l ) -ne 0 ]; then
36 plog=$( hg -R "${repos}" log -r ${rev} --template '{desc|firstline}\n' \
37 |sed -r -e 's,[/ :]+,_,g;' \
39 pname="${p}-${plog}.patch"
40 printf "Revision '%d' --> '%s'\n" ${rev} "${pname}"
41 hg -R "${repos}" diff -c ${rev} --color=never >"${pdir}/${pname}"
42 pdate="$( hg -R "${repos}" log -r ${rev} --template '{date|isodate}\n' )"
43 touch -d "${pdate}" "${pdir}/${pname}"