1 |
Author: grobian |
2 |
Date: 2011-04-28 19:56:18 +0000 (Thu, 28 Apr 2011) |
3 |
New Revision: 1707 |
4 |
|
5 |
Modified: |
6 |
trunk/baselayout-prefix/etc/profile |
7 |
trunk/baselayout-prefix/sbin/runscript.sh |
8 |
Log: |
9 |
unapply prefix-chaining patch (accidential commit) |
10 |
|
11 |
Modified: trunk/baselayout-prefix/etc/profile |
12 |
=================================================================== |
13 |
--- trunk/baselayout-prefix/etc/profile 2011-04-28 18:43:05 UTC (rev 1706) |
14 |
+++ trunk/baselayout-prefix/etc/profile 2011-04-28 19:56:18 UTC (rev 1707) |
15 |
@@ -4,62 +4,6 @@ |
16 |
# environment for login shells. |
17 |
# |
18 |
|
19 |
-# |
20 |
-# for prefix-chaining, the very first thing to do is to load |
21 |
-# the profiles for all chained instances above. |
22 |
-# |
23 |
-# TODO: is it safe in any case to shell source make.conf? |
24 |
-# don't do any recursive expansion here. if the parent can |
25 |
-# use READONLY_EPREFIX's, it has to have the same profile as |
26 |
-# we have here, and thus it will source parents before |
27 |
-# evaluating anything from itself. |
28 |
-# |
29 |
-_ro_root=$(. "@GENTOO_PORTAGE_EPREFIX@"/etc/make.conf && echo $READONLY_EPREFIX) |
30 |
-_ro_deps=${_ro_root#*:} |
31 |
-_ro_root=${_ro_root%:*} |
32 |
- |
33 |
-# |
34 |
-# prevent dooming of _ro_* variables by recursing down the |
35 |
-# profile chain, by backing the up, tagged by resursion depth. |
36 |
-# |
37 |
- |
38 |
-[[ -z "${_ro_recursion_level}" ]] && _ro_recursion_level=0 |
39 |
-((++_ro_recursion_level)) |
40 |
- |
41 |
-for _ro_backup_var in _ro_root _ro_deps; do |
42 |
- eval "_ro_b${_ro_recursion_level}_${_ro_backup_var}=\${${_ro_backup_var}}" |
43 |
-done |
44 |
- |
45 |
-if [ -n "${_ro_root}" -a -f "${_ro_root}"/etc/profile ]; then |
46 |
- . "${_ro_root}"/etc/profile |
47 |
-fi |
48 |
- |
49 |
-for _ro_backup_var in _ro_root _ro_deps; do |
50 |
- eval "${_ro_backup_var}=\${_ro_b${_ro_recursion_level}_${_ro_backup_var}}" |
51 |
-done |
52 |
- |
53 |
-((--_ro_recursion_level)) |
54 |
- |
55 |
-# |
56 |
-# With prefix-chaining we want another set of variables that |
57 |
-# should be retained for all prefixes. for example it is ok |
58 |
-# to retain PKG_CONFIG_PATH if the parent of the chain can |
59 |
-# be used to resolve RDEPEND... |
60 |
-# |
61 |
-if [[ -n "${_ro_root}" ]]; then |
62 |
- _ro_chained_path_vars="PATH MANPATH" |
63 |
- |
64 |
- if [[ ${_ro_deps} == *RDEPEND* ]]; then |
65 |
- _ro_chained_path_vars="${_ro_chained_path_vars} PKG_CONFIG_PATH" |
66 |
- else |
67 |
- unset PKG_CONFIG_PATH |
68 |
- fi |
69 |
- |
70 |
- for var in ${_ro_chained_path_vars}; do |
71 |
- eval "_ro_backupenv_paths_${var}=\${${var}}" |
72 |
- done |
73 |
-fi |
74 |
- |
75 |
# Load environment settings from profile.env, which is created by |
76 |
# env-update from the files in /etc/env.d |
77 |
if [ -e "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env ] ; then |
78 |
@@ -77,17 +21,10 @@ |
79 |
# It is intentional in the following line to use || instead of -o. |
80 |
# This way the evaluation can be short-circuited and calling whoami is |
81 |
# avoided. |
82 |
-# |
83 |
-# system directories are only appended if this prefix is the last |
84 |
-# one in a chain of prefixes (or the only prefix in the chain), so |
85 |
-# that they don't end up in the middle of multiple different prefix |
86 |
-# paths (profile is recursive now, see above!) |
87 |
if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then |
88 |
- PATH="@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/bin:${ROOTPATH}" |
89 |
- [[ -z "${_ro_root}" ]] && PATH="$PATH:/usr/sbin:/usr/bin:/sbin:/bin" |
90 |
+ PATH="@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/bin:${ROOTPATH}:/usr/sbin:/usr/bin:/sbin:/bin" |
91 |
else |
92 |
- PATH="@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:${PATH}" |
93 |
- [[ -z "${_ro_root}" ]] && PATH="$PATH:/usr/bin:/bin" |
94 |
+ PATH="@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:${PATH}:/usr/bin:/bin" |
95 |
fi |
96 |
export PATH |
97 |
unset ROOTPATH |
98 |
@@ -110,34 +47,9 @@ |
99 |
# it in the user's dot-files), but it shouldn't make any |
100 |
# difference. |
101 |
. "@GENTOO_PORTAGE_EPREFIX@"/etc/bash/bashrc |
102 |
- elif [ -n "${_ro_root}" ]; then |
103 |
- # We're in a prefix chain, but have no local bash. we rely on bash |
104 |
- # beeing there _somewhere_ in the chain, so we do not need to set |
105 |
- # PS1 explicitly. |
106 |
- if [ -z "${PS1}" ]; then |
107 |
- # try harder to find something in the parent prefix of the chain. |
108 |
- # dont bother to search multiple chain members up to the top. |
109 |
- if [ -f "${_ro_root}/etc/bash/bashrc" ]; then |
110 |
- . "${_ro_root}/etc/bash/bashrc" |
111 |
- fi |
112 |
- fi |
113 |
else |
114 |
PS1='\u@\h \w \$ ' |
115 |
fi |
116 |
- |
117 |
- # Set the last dirpart of the current prefix somewhere |
118 |
- # in the prompt, so one immediately knows where he/she is. |
119 |
- if [ ${_ro_recursion_level} == 0 ]; then |
120 |
- # we're in the last prefix of the chain here. |
121 |
- _ro_name="@GENTOO_PORTAGE_EPREFIX@" |
122 |
- _ro_name="${_ro_name##*/}" |
123 |
- |
124 |
- # use color only if the prompt already contains color escapes |
125 |
- case "${PS1}" in |
126 |
- *'\[\033['*'m\]'*) PS1="\[\033[01;36m\][${_ro_name}]\[\033[00m\] ${PS1}" ;; |
127 |
- *) PS1="[${_ro_name}] ${PS1}" ;; |
128 |
- esac |
129 |
- fi |
130 |
else |
131 |
# Setup a bland default prompt. Since this prompt should be useable |
132 |
# on color and non-color terminals, as well as shells that don't |
133 |
@@ -145,43 +57,9 @@ |
134 |
PS1="`whoami`@`uname -n | cut -f1 -d.` \$ " |
135 |
fi |
136 |
|
137 |
-# when chaining prefixes, we want the prompt to be passed to the child too, |
138 |
-# so we need to export it. |
139 |
-export PS1 |
140 |
- |
141 |
for sh in "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.d/*.sh ; do |
142 |
if [ -r "$sh" ] ; then |
143 |
. "$sh" |
144 |
fi |
145 |
done |
146 |
unset sh |
147 |
- |
148 |
-# |
149 |
-# finally chain the save variables for previous prefixes in the chain. |
150 |
-# |
151 |
-if [[ -n "${_ro_chained_path_vars}" ]]; then |
152 |
- for var in ${_ro_chained_path_vars}; do |
153 |
- eval "export ${var}=\${${var}}:\${_ro_backupenv_paths_${var}}" |
154 |
- eval "unset _ro_backupenv_paths_${var}" |
155 |
- done |
156 |
-fi |
157 |
- |
158 |
-# |
159 |
-# final finally set EPREFIX to our prefix if we don't have a local portage. this |
160 |
-# was previously done by the startprefix script, but we want to be able to start |
161 |
-# this environment by simply sourcing etc/profile with the correct shell. |
162 |
-# |
163 |
-if [[ -z "${EPREFIX}" ]]; then |
164 |
- if [[ ! -x "@GENTOO_PORTAGE_EPREFIX@"/usr/bin/emerge ]]; then |
165 |
- export EPREFIX="@GENTOO_PORTAGE_EPREFIX@" |
166 |
- fi |
167 |
-elif [[ "${EPREFIX}" != "@GENTOO_PORTAGE_EPREFIX@" && ${_ro_recursion_level} == 0 ]]; then |
168 |
- echo "WARNING: EPREFIX is set from environment to \"${EPREFIX}\"." |
169 |
- echo " You are entering the prefix \"@GENTOO_PORTAGE_EPREFIX@\"." |
170 |
- echo " Having EPREFIX set this way will probably render this environment unusable." |
171 |
-fi |
172 |
- |
173 |
-unset _ro_root |
174 |
-unset _ro_deps |
175 |
-unset _ro_chained_path_vars |
176 |
- |
177 |
|
178 |
Modified: trunk/baselayout-prefix/sbin/runscript.sh |
179 |
=================================================================== |
180 |
--- trunk/baselayout-prefix/sbin/runscript.sh 2011-04-28 18:43:05 UTC (rev 1706) |
181 |
+++ trunk/baselayout-prefix/sbin/runscript.sh 2011-04-28 19:56:18 UTC (rev 1707) |
182 |
@@ -1,4 +1,4 @@ |
183 |
-#! /usr/bin/env bash |
184 |
+#!@GENTOO_PORTAGE_EPREFIX@/bin/bash |
185 |
# Copyright 1999-2007 Gentoo Foundation |
186 |
# Distributed under the terms of the GNU General Public License v2 |