--- trunk/mage/usr/lib/mage/env-rebuild.sh 2011/12/28 10:13:52 1567 +++ trunk/mage/usr/lib/mage/env-rebuild.sh 2011/12/28 10:16:42 1568 @@ -4,9 +4,6 @@ # rebuilds /etc/{ld.so.conf,profile.env} with given files from /etc/env.d # -# sets root path -P="${MROOT}" - SPECIALVARS="KDEDIRS PATH CLASSPATH LDPATH MANPATH INFODIR INFOPATH ROOTPATH" SPECIALVARS+=" CONFIG_PROTECT CONFIG_PROTECT_MASK CONFIG_PROTECT_IGNORE" SPECIALVARS+=" PRELINK_PATH PRELINK_PATH_MASK" @@ -24,14 +21,14 @@ echo -en "\n>>>> Rebuilding environment... " # clean existing conf files -:> ${P}/etc/ld.so.conf -:> ${P}/etc/profile.env +:> ${MROOT}/etc/ld.so.conf +:> ${MROOT}/etc/profile.env # gets everything in /etc/env.d -for file in ${P}/etc/env.d/* +for file in ${MROOT}/etc/env.d/* do # abort if "empty" - [[ ${file} = ${P}/etc/env.d/\* ]] && continue + [[ ${file} = ${MROOT}/etc/env.d/\* ]] && continue # reads content of every file while read path @@ -47,7 +44,7 @@ then #substitudes " from $path if exists path="${path//\"}" #}" <--- make code readable again :) - echo "${path##*=}" >> ${P}/etc/ld.so.conf + echo "${path##*=}" >> ${MROOT}/etc/ld.so.conf else # checks if var exists in specialvars for i in ${SPECIALVARS} @@ -75,7 +72,7 @@ esac else # all other vars go directly to /etc/profile.env - echo "export ${path}" >> ${P}/etc/profile.env + echo "export ${path}" >> ${MROOT}/etc/profile.env fi fi done << EOF @@ -92,17 +89,17 @@ # only OMF_DIR goes to /etc/scrollkeeper.conf if [[ ${i} = OMF_DIR ]] then - echo "${i}=$(cat ${TMPDIR}/${i})" > ${P}/etc/scrollkeeper.conf + echo "${i}=$(cat ${TMPDIR}/${i})" > ${MROOT}/etc/scrollkeeper.conf else - echo "export ${i}=\"$(cat ${TMPDIR}/${i})\"" >> ${P}/etc/profile.env + echo "export ${i}=\"$(cat ${TMPDIR}/${i})\"" >> ${MROOT}/etc/profile.env fi rm ${TMPDIR}/${i} fi done # rebuilds environment -ldconfig -r "${P}" -f /etc/ld.so.conf -C /etc/ld.so.cache -[ -f ${P}/etc/profile ] && source ${P}/etc/profile +ldconfig -r "${MROOT}" -f /etc/ld.so.conf -C /etc/ld.so.cache +[ -f ${MROOT}/etc/profile ] && source ${MROOT}/etc/profile # cleanups [ -d ${TMPDIR} ] && rm -rf ${TMPDIR}