diff -ru baselayout-1.12.5.orig/etc/profile baselayout-1.12.5/etc/profile --- baselayout-1.12.5.orig/etc/profile 2009-07-20 09:10:30 +0200 +++ baselayout-1.12.5/etc/profile 2009-07-20 09:49:01 +0200 @@ -17,10 +17,29 @@ _ro_root=$(. "/tools/mduft/eprefix/preserved"/etc/make.conf && echo $READONLY_EPREFIX) _ro_deps=${_ro_root#*:} _ro_root=${_ro_root%:*} + +# +# prevent dooming of _ro_* variables by recursing down the +# profile chain, by backing the up, tagged by resursion depth. +# + +[[ -z "${_ro_recursion_level}" ]] && _ro_recursion_level=0 +((++_ro_recursion_level)) + +for _ro_backup_var in _ro_root _ro_deps; do + eval "_ro_b${_ro_recursion_level}_${_ro_backup_var}=\${${_ro_backup_var}}" +done + if [ -n "${_ro_root}" -a -f "${_ro_root}"/etc/profile ]; then . "${_ro_root}"/etc/profile fi +for _ro_backup_var in _ro_root _ro_deps; do + eval "${_ro_backup_var}=\${_ro_b${_ro_recursion_level}_${_ro_backup_var}}" +done + +((--_ro_recursion_level)) + # # With prefix-chaining we want another set of variables that # should be retained for all prefixes. for example it is ok