summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-recursion.patch')
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-recursion.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-recursion.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-recursion.patch
new file mode 100644
index 000000000000..71883838e7bd
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-recursion.patch
@@ -0,0 +1,33 @@
+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