blob: 71883838e7bd8f9dda10365f86ae86ed9c88e908 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
|