diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/baselayout-prefix/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/baselayout-prefix/files')
-rw-r--r-- | sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch b/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch new file mode 100644 index 000000000000..98e41b95bb91 --- /dev/null +++ b/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch @@ -0,0 +1,67 @@ +--- baselayout-2.2/etc/profile.orig 2017-03-23 16:46:29.922123300 +0100 ++++ baselayout-2.2/etc/profile 2017-03-23 16:58:43.578360900 +0100 +@@ -4,6 +4,46 @@ + # environment for login shells. + # + ++# ++# for prefix-chaining, the very first thing to do is to load ++# the profiles for all chained instances above. ++# ++# TODO: is it safe in any case to shell source make.conf? ++# don't do any recursive expansion here. if the parent can ++# use READONLY_EPREFIX's, it has to have the same profile as ++# we have here, and thus it will source parents before ++# evaluating anything from itself. ++# ++if [[ -r /etc/portage/make.conf ]]; then ++ _ro_root=$(. /etc/portage/make.conf && echo $READONLY_EPREFIX) ++elif [[ -r /etc/make.conf ]]; then ++ _ro_root=$(. /etc/make.conf && echo $READONLY_EPREFIX) ++else ++ echo "Failed to read" /etc/portage/make.conf >&2 ++fi ++_ro_deps=${_ro_root#*:} ++_ro_root=${_ro_root%:*} ++if [ -n "${_ro_root}" -a -f "${_ro_root}/"etc/profile ]; then ++ . "${_ro_root}/"etc/profile ++fi ++ ++# ++# With prefix-chaining we want another set of variables that ++# should be retained for all prefixes. for example it is ok ++# to retain PKG_CONFIG_PATH if the parent of the chain can ++# be used to resolve RDEPEND... ++# ++if [[ -n "${_ro_root}" ]]; then ++ _ro_chained_path_vars="PATH MANPATH" ++ ++ [[ ${_ro_deps} == *RDEPEND* ]] && ++ _ro_chained_path_vars="${_ro_chained_path_vars} PKG_CONFIG_PATH" ++ ++ for var in ${_ro_chained_path_vars}; do ++ eval "_ro_backupenv_paths_${var}=\${${var}}" ++ done ++fi ++ + # Load environment settings from profile.env, which is created by + # env-update from the files in /etc/env.d + if [ -e /etc/profile.env ] ; then +@@ -61,3 +101,17 @@ + [ -r "$sh" ] && . "$sh" + done + unset sh ++ ++# ++# finally chain the save variables for previous prefixes in the chain. ++# ++if [[ -n "${_ro_chained_path_vars}" ]]; then ++ for var in ${_ro_chained_path_vars}; do ++ eval "export ${var}=\${${var}}:\${_ro_backupenv_paths_${var}}" ++ eval "unset _ro_backupenv_paths_${var}" ++ done ++fi ++ ++unset _ro_root ++unset _ro_deps ++unset _ro_chained_path_vars |