Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r15153 - in main/branches/prefix: bin pym/portage
Date: Mon, 28 Dec 2009 09:25:33
Message-Id: E1NPBqu-0001me-Rq@stork.gentoo.org
1 Author: grobian
2 Date: 2009-12-28 09:25:24 +0000 (Mon, 28 Dec 2009)
3 New Revision: 15153
4
5 Modified:
6 main/branches/prefix/bin/ebuild.sh
7 main/branches/prefix/bin/isolated-functions.sh
8 main/branches/prefix/pym/portage/__init__.py
9 Log:
10 Merged from trunk -r15142:15151
11
12 | 15143 | Remove obsolete backing up of ROOTPATH via PORTAGE_ROOTPATH. |
13 | zmedico | |
14
15 | 15145 | In save_ebuild_env(), preserve all ebuild phases in any case |
16 | zmedico | since excluding the already executed ones from |
17 | | environment.bz2 doesn't save much space, and it's possible |
18 | | that someone would want to look at them later. |
19
20 | 15147 | Remove stray echo. |
21 | zmedico | |
22
23 | 15149 | Bug #297364 - Only set EAPI conditional PATH once after |
24 | zmedico | sourcing the ebuild (when the EAPI is first known) rather |
25 | | than for each phase. |
26
27
28 Modified: main/branches/prefix/bin/ebuild.sh
29 ===================================================================
30 --- main/branches/prefix/bin/ebuild.sh 2009-12-24 06:20:04 UTC (rev 15152)
31 +++ main/branches/prefix/bin/ebuild.sh 2009-12-28 09:25:24 UTC (rev 15153)
32 @@ -17,13 +17,6 @@
33 done
34 unset x
35
36 -# sandbox's bashrc sources /etc/profile which unsets ROOTPATH,
37 -# so we have to back it up and restore it.
38 -if [ -n "${PORTAGE_ROOTPATH}" ] ; then
39 - export ROOTPATH=${PORTAGE_ROOTPATH}
40 - unset PORTAGE_ROOTPATH
41 -fi
42 -
43 ROOTPATH=${ROOTPATH##:}
44 ROOTPATH=${ROOTPATH%%:}
45 PREROOTPATH=${PREROOTPATH##:}
46 @@ -1113,7 +1106,7 @@
47 unset f
48
49 save_ebuild_env --exclude-init-phases | filter_readonly_variables \
50 - --filter-sandbox --allow-extra-vars > environment
51 + --filter-path --filter-sandbox --allow-extra-vars > environment
52
53 bzip2 -f9 environment
54
55 @@ -1647,6 +1640,11 @@
56 # settings should be used when loading the environment from a binary or
57 # installed package.
58 #
59 +# --filter-path causes the PATH variable to be filtered. This variable
60 +# should persist between phases, in case it is modified by the ebuild.
61 +# However, old settings should be overridden when loading the
62 +# environment from a binary or installed package.
63 +#
64 # ---allow-extra-vars causes some extra vars to be allowd through, such
65 # as ${PORTAGE_SAVED_READONLY_VARS} and ${PORTAGE_MUTABLE_FILTERED_VARS}.
66 #
67 @@ -1666,7 +1664,7 @@
68 SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
69 SANDBOX_LOG SANDBOX_ON"
70 filtered_vars="$readonly_bash_vars $bash_misc_vars
71 - $READONLY_PORTAGE_VARS PATH"
72 + $READONLY_PORTAGE_VARS"
73 if hasq --filter-sandbox $* ; then
74 filtered_vars="${filtered_vars} SANDBOX_.*"
75 else
76 @@ -1675,6 +1673,9 @@
77 if hasq --filter-features $* ; then
78 filtered_vars="${filtered_vars} FEATURES"
79 fi
80 + if hasq --filter-path $* ; then
81 + filtered_vars+=" PATH"
82 + fi
83 if hasq --filter-locale $* ; then
84 filtered_vars+=" LANG LC_ALL LC_COLLATE
85 LC_CTYPE LC_MESSAGES LC_MONETARY
86 @@ -1705,7 +1706,7 @@
87 # environment may contain stale SANDBOX_{DENY,PREDICT,READ,WRITE}
88 # and FEATURES variables that should be filtered out. Between
89 # phases, these variables are normally preserved.
90 - filter_opts+=" --filter-sandbox --filter-features --filter-locale"
91 + filter_opts+=" --filter-features --filter-locale --filter-path --filter-sandbox"
92 fi
93 filter_readonly_variables ${filter_opts} < "${T}"/environment \
94 > "${T}"/environment.filtered || return $?
95 @@ -1922,6 +1923,39 @@
96
97 unset _f _valid_phases
98
99 + if [[ $EBUILD_PHASE != depend ]] ; then
100 +
101 + case "$EAPI" in
102 + 4|4_pre1)
103 + _ebuild_helpers_path="$PORTAGE_BIN_PATH/ebuild-helpers/4:$PORTAGE_BIN_PATH/ebuild-helpers"
104 + ;;
105 + *)
106 + _ebuild_helpers_path="$PORTAGE_BIN_PATH/ebuild-helpers"
107 + ;;
108 + esac
109 +
110 + #PATH=$ebuild_helpers_path:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${ROOTPATH:+:}$ROOTPATH
111 + # PREFIX: same notes apply as at the top of this file
112 + PATH="$ebuild_helpers_path:$PREROOTPATH${PREROOTPATH:+:}${DEFAULT_PATH}${ROOTPATH:+:}$ROOTPATH${EXTRA_PATH:+:}${EXTRA_PATH}"
113 + unset _ebuild_helpers_path
114 +
115 + if hasq distcc $FEATURES ; then
116 + PATH="${EPREFIX}/usr/lib/distcc/bin:$PATH"
117 + [[ -n $DISTCC_LOG ]] && addwrite "${DISTCC_LOG%/*}"
118 + fi
119 +
120 + if hasq ccache $FEATURES ; then
121 + PATH="${EPREFIX}/usr/lib/ccache/bin:$PATH"
122 +
123 + if [[ -n $CCACHE_DIR ]] ; then
124 + addread "$CCACHE_DIR"
125 + addwrite "$CCACHE_DIR"
126 + fi
127 +
128 + [[ -n $CCACHE_SIZE ]] && ccache -M $CCACHE_SIZE &> /dev/null
129 + fi
130 + fi
131 +
132 # This needs to be exported since prepstrip is a separate shell script.
133 [[ -n $QA_PRESTRIPPED ]] && export QA_PRESTRIPPED
134 eval "[[ -n \$QA_PRESTRIPPED_${ARCH/-/_} ]] && export QA_PRESTRIPPED_${ARCH/-/_}"
135 @@ -1957,44 +1991,11 @@
136 ebuild_main() {
137 local f x
138
139 - # we may want to make this configurable somewhere else
140 - local ebuild_helpers_path
141 - case ${EAPI} in
142 - 4|4_pre1)
143 - ebuild_helpers_path="${PORTAGE_BIN_PATH}/ebuild-helpers/4:${PORTAGE_BIN_PATH}/ebuild-helpers"
144 - ;;
145 - *)
146 - ebuild_helpers_path="${PORTAGE_BIN_PATH}/ebuild-helpers"
147 - ;;
148 - esac
149 + if [[ $EBUILD_PHASE != depend ]] ; then
150 + # Force configure scripts that automatically detect ccache to
151 + # respect FEATURES="-ccache".
152 + hasq ccache $FEATURES || export CCACHE_DISABLE=1
153
154 - #PATH=$ebuild_helpers_path:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${ROOTPATH:+:}$ROOTPATH
155 - # PREFIX: same notes apply as at the top of this file
156 - PATH="$ebuild_helpers_path:$PREROOTPATH${PREROOTPATH:+:}${DEFAULT_PATH}${ROOTPATH:+:}$ROOTPATH${EXTRA_PATH:+:}${EXTRA_PATH}"
157 - unset ebuild_helpers_path
158 -
159 - if ! hasq $EBUILD_SH_ARGS clean depend help info nofetch ; then
160 -
161 - if hasq distcc $FEATURES ; then
162 - export PATH="${EPREFIX}/usr/lib/distcc/bin:$PATH"
163 - [[ -n $DISTCC_LOG ]] && addwrite "${DISTCC_LOG%/*}"
164 - fi
165 -
166 - if hasq ccache $FEATURES ; then
167 - export PATH="${EPREFIX}/usr/lib/ccache/bin:$PATH"
168 -
169 - addread "$CCACHE_DIR"
170 - addwrite "$CCACHE_DIR"
171 -
172 - [[ -n $CCACHE_SIZE ]] && ccache -M $CCACHE_SIZE &> /dev/null
173 - else
174 - # Force configure scripts that automatically detect ccache to
175 - # respect FEATURES="-ccache".
176 - export CCACHE_DISABLE=1
177 - fi
178 - fi
179 -
180 - if [[ $EBUILD_PHASE != depend ]] ; then
181 local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
182 [[ -n $phase_func ]] && _ebuild_phase_funcs "$EAPI" "$phase_func"
183 unset phase_func
184 @@ -2024,7 +2025,8 @@
185 # Update environment.bz2 in case installation phases
186 # need to pass some variables to uninstallation phases.
187 save_ebuild_env --exclude-init-phases | \
188 - filter_readonly_variables --filter-sandbox --allow-extra-vars \
189 + filter_readonly_variables --filter-path \
190 + --filter-sandbox --allow-extra-vars \
191 | bzip2 -c -f9 > "$PORTAGE_UPDATE_ENV"
192 fi
193 ;;
194
195 Modified: main/branches/prefix/bin/isolated-functions.sh
196 ===================================================================
197 --- main/branches/prefix/bin/isolated-functions.sh 2009-12-24 06:20:04 UTC (rev 15152)
198 +++ main/branches/prefix/bin/isolated-functions.sh 2009-12-28 09:25:24 UTC (rev 15153)
199 @@ -504,8 +504,6 @@
200
201 if hasq --exclude-init-phases $* ; then
202 unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_
203 - unset -f pkg_nofetch src_unpack src_prepare src_configure \
204 - src_compile src_test src_install
205 if [[ -n $PYTHONPATH ]] ; then
206 export PYTHONPATH=${PYTHONPATH/${PORTAGE_PYM_PATH}:}
207 [[ -z $PYTHONPATH ]] && unset PYTHONPATH
208
209 Modified: main/branches/prefix/pym/portage/__init__.py
210 ===================================================================
211 --- main/branches/prefix/pym/portage/__init__.py 2009-12-24 06:20:04 UTC (rev 15152)
212 +++ main/branches/prefix/pym/portage/__init__.py 2009-12-28 09:25:24 UTC (rev 15153)
213 @@ -3797,12 +3797,6 @@
214 if eapi not in ("0", "1", "2", "3", "3_pre2"):
215 mydict.pop("AA", None)
216
217 - # sandbox's bashrc sources /etc/profile which unsets ROOTPATH,
218 - # so we have to back it up and restore it.
219 - rootpath = mydict.get("ROOTPATH")
220 - if rootpath:
221 - mydict["PORTAGE_ROOTPATH"] = rootpath
222 -
223 return mydict
224
225 def thirdpartymirrors(self):