Index: lib/tinderlib.sh =================================================================== RCS file: /space/cvs/marcuscom-cvs/portstools/tinderbox/lib/tinderlib.sh,v retrieving revision 1.72 diff -u -r1.72 tinderlib.sh --- lib/tinderlib.sh 16 Jul 2012 22:01:07 -0000 1.72 +++ lib/tinderlib.sh 17 Jul 2012 21:34:36 -0000 @@ -435,25 +435,36 @@ jail=$1 portstree=$2 build=$3 + major_version=$4 - $(tinderLoc scripts tc) configGet + envdir=$(tinderLoc scripts etc/env) - cat $(tinderLoc scripts lib/tinderbox.env) + cat $(tinderLoc scripts lib/tinderbox.env) \ + | sed -E \ + -e "s|^#${major_version}||" \ + -e 's|\^\^([^\^]+)\^\^|${\1}|g' \ + -e 's|^#.*$||' - envdir=$(tinderLoc scripts etc/env) + { + $(tinderLoc scripts tc) configGet - if [ -f ${envdir}/GLOBAL ]; then + + if [ -s ${envdir}/GLOBAL ]; then cat ${envdir}/GLOBAL fi - if [ -n "${jail}" -a -f ${envdir}/jail.${jail} ]; then + if [ -n "${jail}" -a -s ${envdir}/jail.${jail} ]; then cat ${envdir}/jail.${jail} fi - if [ -n "${portstree}" -a -f ${envdir}/portstree.${portstree} ]; then + if [ -n "${portstree}" -a -s ${envdir}/portstree.${portstree} ]; then cat ${envdir}/portstree.${portstree} fi - if [ -n "${build}" -a -f ${envdir}/build.${build} ]; then + if [ -n "${build}" -a -s ${envdir}/build.${build} ]; then cat ${envdir}/build.${build} fi + } | sed \ + -e 's|^#.*$||' \ + -e "s|^export ||" \ + -e 's|[[:blank:]]||g' } cleanenv () { @@ -486,13 +497,9 @@ eval "export SRCBASE=${SRCBASE:-`realpath $(tinderLoc jail ${jail})/src`}" \ >/dev/null 2>&1 - for _tb_var in $(buildenvlist "${jail}" "${portstree}" "${build}") + for _tb_var in $(buildenvlist "${jail}" "${portstree}" "${build}" "${major_version}") do - var=$(echo "${_tb_var}" | sed \ - -e "s|^#${major_version}||" \ - -e "s|^export ||" \ - -E -e 's|\^\^([^\^]+)\^\^|${\1}|g' -e 's|^#.*$||') - + var=$(echo "${_tb_var}") if [ -n "${var}" ]; then eval "export ${var}" >/dev/null 2>&1 fi