1 |
commit: d038cfcd7eb952e0d4017b66c35ba2734859bfb7 |
2 |
Author: Thomas Sachau <tommy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 26 15:04:00 2012 +0000 |
4 |
Commit: Thomas Sachau <tommy <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 26 15:04:00 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d038cfcd |
7 |
|
8 |
phase-functions.sh: Move multilib behind force-multilib FEATURE |
9 |
|
10 |
--- |
11 |
bin/phase-functions.sh | 337 +++++++++++++++++++++++++++--------------------- |
12 |
1 files changed, 192 insertions(+), 145 deletions(-) |
13 |
|
14 |
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh |
15 |
index 538cae5..7307b76 100644 |
16 |
--- a/bin/phase-functions.sh |
17 |
+++ b/bin/phase-functions.sh |
18 |
@@ -225,34 +225,42 @@ dyn_pretend() { |
19 |
} |
20 |
|
21 |
dyn_setup() { |
22 |
- if ! is_auto-multilib && ! use multilib_abi_"${DEFAULT_ABI}" ; then |
23 |
- ewarn |
24 |
- ewarn "You disabled all ABIs" |
25 |
- ewarn "You should enable at least one ABI" |
26 |
- ewarn "Enabling the default ABI now" |
27 |
- ewarn |
28 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
29 |
+ if ! is_auto-multilib && ! use multilib_abi_"${DEFAULT_ABI}" ; then |
30 |
+ ewarn |
31 |
+ ewarn "You disabled all ABIs" |
32 |
+ ewarn "You should enable at least one ABI" |
33 |
+ ewarn "Enabling the default ABI now" |
34 |
+ ewarn |
35 |
+ fi |
36 |
fi |
37 |
for LOOP_ABI in $(get_abi_list); do |
38 |
- set_abi ${LOOP_ABI} |
39 |
- if is_ebuild; then |
40 |
- source "${T}"/environment || die |
41 |
- else |
42 |
- rm -f "${T}"/environment |
43 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
44 |
+ set_abi ${LOOP_ABI} |
45 |
+ if is_ebuild; then |
46 |
+ source "${T}"/environment || die |
47 |
+ else |
48 |
+ rm -f "${T}"/environment |
49 |
+ fi |
50 |
+ if [[ -e $PORTAGE_BUILDDIR/.setuped.${ABI} ]] ; then |
51 |
+ vecho ">>> It appears that '$PF' is already setup; skipping." |
52 |
+ vecho ">>> Remove '$PORTAGE_BUILDDIR/.setuped.${ABI}' to force setup." |
53 |
+ return 0 |
54 |
+ fi |
55 |
fi |
56 |
- if [[ -e $PORTAGE_BUILDDIR/.setuped.${ABI} ]] ; then |
57 |
- vecho ">>> It appears that '$PF' is already setup; skipping." |
58 |
- vecho ">>> Remove '$PORTAGE_BUILDDIR/.setuped.${ABI}' to force setup." |
59 |
- return 0 |
60 |
- fi |
61 |
ebuild_phase pre_pkg_setup |
62 |
ebuild_phase pkg_setup |
63 |
>> "$PORTAGE_BUILDDIR/.setuped.${ABI}" || \ |
64 |
die "Failed to create $PORTAGE_BUILDDIR/.setuped" |
65 |
- ebuild_phase post_pkg_setup |
66 |
|
67 |
- is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
68 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
69 |
done |
70 |
- is_ebuild && { rm "${T}"/environment || die ; } |
71 |
+ |
72 |
+ >> "$PORTAGE_BUILDDIR/.setuped" || \ |
73 |
+ die "Failed to create $PORTAGE_BUILDDIR/.setuped" |
74 |
+ ebuild_phase post_pkg_setup |
75 |
+ |
76 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_ebuild && { rm "${T}"/environment || die ; } |
77 |
} |
78 |
|
79 |
dyn_unpack() { |
80 |
@@ -268,12 +276,14 @@ dyn_unpack() { |
81 |
vecho ">>> Unpacking source$(_get_abi_string)..." |
82 |
ebuild_phase src_unpack |
83 |
|
84 |
- if is_auto-multilib && is_ebuild; then |
85 |
- >> "$PORTAGE_BUILDDIR"/.unpacked."${LOOP_ABI}" || die "IO Failure -- Failed to 'touch .unpacked.${LOOP_ABI}'" |
86 |
- fi |
87 |
- is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
88 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
89 |
+ if is_auto-multilib && is_ebuild; then |
90 |
+ >> "$PORTAGE_BUILDDIR"/.unpacked."${LOOP_ABI}" || die "IO Failure -- Failed to 'touch .unpacked.${LOOP_ABI}'" |
91 |
+ fi |
92 |
+ is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
93 |
|
94 |
- is_ebuild && { rm "${T}"/environment || die ; } |
95 |
+ is_ebuild && { rm "${T}"/environment || die ; } |
96 |
+ fi |
97 |
>> "$PORTAGE_BUILDDIR/.unpacked" || \ |
98 |
die "Failed to create $PORTAGE_BUILDDIR/.unpacked" |
99 |
vecho ">>> Source unpacked in ${WORKDIR}" |
100 |
@@ -392,13 +402,15 @@ dyn_prepare() { |
101 |
fi |
102 |
|
103 |
for LOOP_ABI in $(get_abi_list); do |
104 |
- is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
105 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
106 |
+ is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
107 |
|
108 |
- if [ "${PORTAGE_BUILDDIR}"/.prepared.${LOOP_ABI} -nt "${WORKDIR}" ]; then |
109 |
- echo ">>> It appears that ${PN} is already prepared for ABI=${LOOP_ABI}; skipping." |
110 |
- echo ">>> Remove '$PORTAGE_BUILDDIR/.prepared.${LOOP_ABI}' to force prepare." |
111 |
- continue |
112 |
- fi |
113 |
+ if [ "${PORTAGE_BUILDDIR}"/.prepared.${LOOP_ABI} -nt "${WORKDIR}" ]; then |
114 |
+ echo ">>> It appears that ${PN} is already prepared for ABI=${LOOP_ABI}; skipping." |
115 |
+ echo ">>> Remove '$PORTAGE_BUILDDIR/.prepared.${LOOP_ABI}' to force prepare." |
116 |
+ continue |
117 |
+ fi |
118 |
+ fi |
119 |
if [[ -d $S ]] ; then |
120 |
cd "${S}" |
121 |
elif has $EAPI 0 1 2 3 3_pre2 ; then |
122 |
@@ -415,12 +427,14 @@ dyn_prepare() { |
123 |
vecho ">>> Preparing source in $PWD$(_get_abi_string) ..." |
124 |
ebuild_phase src_prepare |
125 |
|
126 |
- if is_auto-multilib && is_ebuild; then |
127 |
- >> "$PORTAGE_BUILDDIR"/.prepared."${LOOP_ABI}" || die "IO Failure -- Failed to 'touch .prepared.${LOOP_ABI}'" |
128 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
129 |
+ if is_auto-multilib && is_ebuild; then |
130 |
+ >> "$PORTAGE_BUILDDIR"/.prepared."${LOOP_ABI}" || die "IO Failure -- Failed to 'touch .prepared.${LOOP_ABI}'" |
131 |
+ fi |
132 |
+ is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
133 |
fi |
134 |
- is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
135 |
done |
136 |
- is_ebuild && { rm "${T}"/environment || die ; } |
137 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_ebuild && { rm "${T}"/environment || die ; } |
138 |
|
139 |
>> "$PORTAGE_BUILDDIR/.prepared" || \ |
140 |
die "Failed to create $PORTAGE_BUILDDIR/.prepared" |
141 |
@@ -439,13 +453,15 @@ dyn_configure() { |
142 |
fi |
143 |
|
144 |
for LOOP_ABI in $(get_abi_list); do |
145 |
- is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
146 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
147 |
+ is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
148 |
|
149 |
- if [ ${PORTAGE_BUILDDIR}/.configured.${LOOP_ABI} -nt "${WORKDIR}" ]; then |
150 |
- echo ">>> It appears that ${PN} is already configured for ABI=${LOOP_ABI}; skipping." |
151 |
- echo ">>> Remove '$PORTAGE_BUILDDIR/.configured.${LOOP_ABI}' to force configuration." |
152 |
- continue |
153 |
- fi |
154 |
+ if [ ${PORTAGE_BUILDDIR}/.configured.${LOOP_ABI} -nt "${WORKDIR}" ]; then |
155 |
+ echo ">>> It appears that ${PN} is already configured for ABI=${LOOP_ABI}; skipping." |
156 |
+ echo ">>> Remove '$PORTAGE_BUILDDIR/.configured.${LOOP_ABI}' to force configuration." |
157 |
+ continue |
158 |
+ fi |
159 |
+ fi |
160 |
if [[ -d $S ]] ; then |
161 |
cd "${S}" |
162 |
elif has $EAPI 0 1 2 3 3_pre2 ; then |
163 |
@@ -463,12 +479,14 @@ dyn_configure() { |
164 |
vecho ">>> Configuring source in $PWD$(_get_abi_string) ..." |
165 |
ebuild_phase src_configure |
166 |
|
167 |
- if is_auto-multilib && is_ebuild; then |
168 |
- >> "$PORTAGE_BUILDDIR"/.configured."${LOOP_ABI}" || die "IO Failure -- Failed to 'touch .configured.${LOOP_ABI}'" |
169 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
170 |
+ if is_auto-multilib && is_ebuild; then |
171 |
+ >> "$PORTAGE_BUILDDIR"/.configured."${LOOP_ABI}" || die "IO Failure -- Failed to 'touch .configured.${LOOP_ABI}'" |
172 |
+ fi |
173 |
+ is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
174 |
fi |
175 |
- is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
176 |
done |
177 |
- is_ebuild && { rm "${T}"/environment || die ; } |
178 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_ebuild && { rm "${T}"/environment || die ; } |
179 |
>> "$PORTAGE_BUILDDIR/.configured" || \ |
180 |
die "Failed to create $PORTAGE_BUILDDIR/.configured" |
181 |
vecho ">>> Source configured." |
182 |
@@ -487,12 +505,14 @@ dyn_compile() { |
183 |
fi |
184 |
|
185 |
for LOOP_ABI in $(get_abi_list); do |
186 |
- is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
187 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
188 |
+ is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
189 |
|
190 |
- if [ ${PORTAGE_BUILDDIR}/.compiled.${LOOP_ABI} -nt "${WORKDIR}" ]; then |
191 |
- echo ">>> It appears that ${PN} is already compiled for ABI=${LOOP_ABI}; skipping." |
192 |
- echo ">>> Remove '$PORTAGE_BUILDDIR/.compiled.${LOOP_ABI}' to force compilation." |
193 |
- continue |
194 |
+ if [ ${PORTAGE_BUILDDIR}/.compiled.${LOOP_ABI} -nt "${WORKDIR}" ]; then |
195 |
+ echo ">>> It appears that ${PN} is already compiled for ABI=${LOOP_ABI}; skipping." |
196 |
+ echo ">>> Remove '$PORTAGE_BUILDDIR/.compiled.${LOOP_ABI}' to force compilation." |
197 |
+ continue |
198 |
+ fi |
199 |
fi |
200 |
if [[ -d $S ]] ; then |
201 |
cd "${S}" |
202 |
@@ -518,12 +538,14 @@ dyn_compile() { |
203 |
vecho ">>> Compiling source in $PWD$(_get_abi_string) ..." |
204 |
ebuild_phase src_compile |
205 |
|
206 |
- if is_auto-multilib && is_ebuild; then |
207 |
- >> "$PORTAGE_BUILDDIR"/.compiled."${LOOP_ABI}" || die "IO Failure -- Failed to 'touch .compiled.${LOOP_ABI}'" |
208 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
209 |
+ if is_auto-multilib && is_ebuild; then |
210 |
+ >> "$PORTAGE_BUILDDIR"/.compiled."${LOOP_ABI}" || die "IO Failure -- Failed to 'touch .compiled.${LOOP_ABI}'" |
211 |
+ fi |
212 |
+ is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
213 |
fi |
214 |
- is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
215 |
done |
216 |
- is_ebuild && { rm "${T}"/environment || die ; } |
217 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_ebuild && { rm "${T}"/environment || die ; } |
218 |
>> "$PORTAGE_BUILDDIR/.compiled" || \ |
219 |
die "Failed to create $PORTAGE_BUILDDIR/.compiled" |
220 |
vecho ">>> Source compiled." |
221 |
@@ -534,7 +556,6 @@ dyn_compile() { |
222 |
} |
223 |
|
224 |
dyn_test() { |
225 |
- |
226 |
if [[ -e $PORTAGE_BUILDDIR/.tested ]] ; then |
227 |
vecho ">>> It appears that ${PN} has already been tested; skipping." |
228 |
vecho ">>> Remove '${PORTAGE_BUILDDIR}/.tested' to force test." |
229 |
@@ -549,7 +570,7 @@ dyn_test() { |
230 |
|
231 |
trap "abort_test" SIGINT SIGQUIT |
232 |
for LOOP_ABI in $(get_abi_list); do |
233 |
- is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
234 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
235 |
|
236 |
if [ -d "${S}" ]; then |
237 |
cd "${S}" |
238 |
@@ -563,10 +584,12 @@ dyn_test() { |
239 |
einfo "Skipping make test/check due to ebuild restriction." |
240 |
vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}" |
241 |
else |
242 |
- if [ ${PORTAGE_BUILDDIR}/.tested.${LOOP_ABI} -nt "${WORKDIR}" ]; then |
243 |
- echo ">>> It appears that ${PN} is already tested for ABI=${LOOP_ABI}; skipping." |
244 |
- echo ">>> Remove '$PORTAGE_BUILDDIR/.tested.${LOOP_ABI}' to force testing." |
245 |
- continue |
246 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
247 |
+ if [ ${PORTAGE_BUILDDIR}/.tested.${LOOP_ABI} -nt "${WORKDIR}" ]; then |
248 |
+ echo ">>> It appears that ${PN} is already tested for ABI=${LOOP_ABI}; skipping." |
249 |
+ echo ">>> Remove '$PORTAGE_BUILDDIR/.tested.${LOOP_ABI}' to force testing." |
250 |
+ continue |
251 |
+ fi |
252 |
fi |
253 |
|
254 |
local save_sp=${SANDBOX_PREDICT} |
255 |
@@ -574,18 +597,20 @@ dyn_test() { |
256 |
ebuild_phase pre_src_test |
257 |
ebuild_phase src_test |
258 |
|
259 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
260 |
if is_auto-multilib && is_ebuild; then |
261 |
>> "$PORTAGE_BUILDDIR"/.tested."${LOOP_ABI}" || die "IO Failure -- Failed to 'touch .tested.${LOOP_ABI}'" |
262 |
fi |
263 |
+ fi |
264 |
>> "$PORTAGE_BUILDDIR/.tested" || \ |
265 |
die "Failed to create $PORTAGE_BUILDDIR/.tested" |
266 |
ebuild_phase post_src_test |
267 |
SANDBOX_PREDICT=${save_sp} |
268 |
fi |
269 |
|
270 |
- is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
271 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_ebuild && { unset_abi; source "${T}"/environment || die ; } |
272 |
done |
273 |
- is_ebuild && { rm "${T}"/environment || die ; } |
274 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_ebuild && { rm "${T}"/environment || die ; } |
275 |
|
276 |
trap - SIGINT SIGQUIT |
277 |
} |
278 |
@@ -606,11 +631,11 @@ dyn_install() { |
279 |
[[ " ${FEATURES} " == *" force-prefix "* ]] || \ |
280 |
case "$EAPI" in 0|1|2) _x=${D} ;; esac |
281 |
rm -rf "${D}" |
282 |
- is_auto-multilib && rm -rf "${D}".${ABI} |
283 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_auto-multilib && rm -rf "${D}".${ABI} |
284 |
mkdir -p "${_x}" |
285 |
unset _x |
286 |
- for LOOP_ABI in $(get_abi_list); do |
287 |
- is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
288 |
+ for LOOP_ABI in $(get_abi_list); do |
289 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && is_ebuild && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
290 |
|
291 |
if [[ -d $S ]] ; then |
292 |
cd "${S}" |
293 |
@@ -638,7 +663,7 @@ dyn_install() { |
294 |
|
295 |
ebuild_phase src_install |
296 |
|
297 |
- if is_auto-multilib ; then |
298 |
+ if ( [[ " ${FEATURES} " == *" force-multilib "* ]] && is_auto-multilib ) ; then |
299 |
_finalize_abi_install |
300 |
cp "${T}"/environment "${PORTAGE_BUILDDIR}"/build-info/environment.${LOOP_ABI} || die |
301 |
if is_ebuild; then |
302 |
@@ -648,14 +673,16 @@ dyn_install() { |
303 |
fi |
304 |
done |
305 |
if [[ -d "${D}" ]]; then |
306 |
- if [[ ${CATEGORY}/${PN} == sys-devel/libtool ]] ; then |
307 |
- ewarn "Preserving libltdl.la because of extensive usage" |
308 |
- ewarn "even in m4 macros of libtool" |
309 |
- elif [[ ${CATEGORY}/${PN} == media-libs/gst-plugins-* ]] ; then |
310 |
- ewarn "Preserving .la files for gst plugins" |
311 |
- ewarn "because of broken Gentoo package" |
312 |
- else |
313 |
- find "${D}" -name '*.la' ! -exec grep -q shouldnotlink=yes {} \; -exec rm {} \; |
314 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
315 |
+ if [[ ${CATEGORY}/${PN} == sys-devel/libtool ]] ; then |
316 |
+ ewarn "Preserving libltdl.la because of extensive usage" |
317 |
+ ewarn "even in m4 macros of libtool" |
318 |
+ elif [[ ${CATEGORY}/${PN} == media-libs/gst-plugins-* ]] ; then |
319 |
+ ewarn "Preserving .la files for gst plugins" |
320 |
+ ewarn "because of broken Gentoo package" |
321 |
+ else |
322 |
+ find "${D}" -name '*.la' ! -exec grep -q shouldnotlink=yes {} \; -exec rm {} \; |
323 |
+ fi |
324 |
fi |
325 |
|
326 |
>> "$PORTAGE_BUILDDIR/.installed" || \ |
327 |
@@ -681,18 +708,20 @@ dyn_install() { |
328 |
[[ -n $x ]] && echo "$x" > $f |
329 |
done |
330 |
fi |
331 |
- if has_multilib_profile ; then |
332 |
- local i= x= |
333 |
- for i in ${MULTILIB_ABIS} ; do |
334 |
- x+=" multilib_abi_${i}" |
335 |
- done |
336 |
- echo "${IUSE}${x}" > IUSE |
337 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
338 |
+ if has_multilib_profile ; then |
339 |
+ local i= x= |
340 |
+ for i in ${MULTILIB_ABIS} ; do |
341 |
+ x+=" multilib_abi_${i}" |
342 |
+ done |
343 |
+ echo "${IUSE}${x}" > IUSE |
344 |
+ fi |
345 |
+ if is_auto-multilib; then |
346 |
+ echo "$(get_abi_order)" > MULTILIB_ABIS |
347 |
+ fi |
348 |
fi |
349 |
echo "${USE}" > USE |
350 |
echo "${EAPI:-0}" > EAPI |
351 |
- if is_auto-multilib; then |
352 |
- echo "$(get_abi_order)" > MULTILIB_ABIS |
353 |
- fi |
354 |
|
355 |
# Save EPREFIX, since it makes it easy to use chpathtool to |
356 |
# adjust the content of a binary package so that it will |
357 |
@@ -726,21 +755,21 @@ dyn_install() { |
358 |
fi |
359 |
|
360 |
else |
361 |
- cd "${PORTAGE_BUILDDIR}" |
362 |
- if [[ $EMERGE_FROM = binary ]] || ! has keepwork $FEATURES; then |
363 |
- rm -f "$PORTAGE_BUILDDIR"/.{ebuild_changed,exit_status,logid,unpacked,prepared} \ |
364 |
- "$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} \ |
365 |
- "$PORTAGE_BUILDDIR"/.die_hooks |
366 |
- |
367 |
-# rm -rf "${PORTAGE_BUILDDIR}/build-info" |
368 |
- rm -rf "${WORKDIR}" |
369 |
- fi |
370 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
371 |
+ cd "${PORTAGE_BUILDDIR}" |
372 |
+ if [[ $EMERGE_FROM = binary ]] || ! has keepwork $FEATURES; then |
373 |
+ rm -f "$PORTAGE_BUILDDIR"/.{ebuild_changed,exit_status,logid,unpacked,prepared} \ |
374 |
+ "$PORTAGE_BUILDDIR"/.{configured,compiled,tested,packaged} \ |
375 |
+ "$PORTAGE_BUILDDIR"/.die_hooks |
376 |
+ |
377 |
+ rm -rf "${WORKDIR}" |
378 |
+ fi |
379 |
|
380 |
- if [ -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then |
381 |
- find "${PORTAGE_BUILDDIR}" -type d ! -regex "^${WORKDIR}" | sort -r | tr "\n" "\0" | $XARGS -0 rmdir &>/dev/null |
382 |
+ if [ -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then |
383 |
+ find "${PORTAGE_BUILDDIR}" -type d ! -regex "^${WORKDIR}" | sort -r | tr "\n" "\0" | $XARGS -0 rmdir &>/dev/null |
384 |
+ fi |
385 |
fi |
386 |
fi |
387 |
- |
388 |
trap - SIGINT SIGQUIT |
389 |
} |
390 |
|
391 |
@@ -750,11 +779,9 @@ dyn_preinst() { |
392 |
return 1 |
393 |
fi |
394 |
for LOOP_ABI in $(get_abi_order); do |
395 |
- set_abi ${LOOP_ABI}; source "${T}"/environment || die |
396 |
- |
397 |
- ebuild_phase_with_hooks pkg_preinst |
398 |
- |
399 |
- unset_abi; source "${T}"/environment || die |
400 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && { set_abi ${LOOP_ABI}; source "${T}"/environment || die ; } |
401 |
+ ebuild_phase_with_hooks pkg_preinst |
402 |
+ [[ " ${FEATURES} " == *" force-multilib "* ]] && { unset_abi; source "${T}"/environment || die ; } |
403 |
done |
404 |
} |
405 |
|
406 |
@@ -1035,24 +1062,62 @@ ebuild_main() { |
407 |
fi |
408 |
;; |
409 |
prerm|postrm|postinst) |
410 |
- for LOOP_ABI in $(get_abi_order); do |
411 |
- if is_auto-multilib ; then |
412 |
- case ${1} in |
413 |
- postinst) |
414 |
- set_abi ${LOOP_ABI} |
415 |
- ;; |
416 |
- prerm|postrm) |
417 |
- # if = backward compactibility for previous versions, which did not |
418 |
- # install a per-ABI environment |
419 |
- if [[ -f "${ROOT}"var/db/pkg/${CATEGORY}/${PF}/environment.${LOOP_ABI}.bz2 ]] ; then |
420 |
- bzcat "${ROOT}"var/db/pkg/${CATEGORY}/${PF}/environment.${LOOP_ABI}.bz2 > "${T}"/environment || die |
421 |
- preprocess_ebuild_env --filter-metadata |
422 |
- fi |
423 |
- ;; |
424 |
- esac |
425 |
- # >/dev/null = backward compactibility for prerm/postrm |
426 |
- source "${T}"/environment 2>/dev/null || die |
427 |
- fi |
428 |
+ if [[ " ${FEATURES} " == *" force-multilib "* ]]; then |
429 |
+ for LOOP_ABI in $(get_abi_order); do |
430 |
+ if is_auto-multilib ; then |
431 |
+ case ${1} in |
432 |
+ postinst) |
433 |
+ set_abi ${LOOP_ABI} |
434 |
+ ;; |
435 |
+ prerm|postrm) |
436 |
+ # if = backward compactibility for previous versions, which did not |
437 |
+ # install a per-ABI environment |
438 |
+ if [[ -f "${ROOT}"var/db/pkg/${CATEGORY}/${PF}/environment.${LOOP_ABI}.bz2 ]] ; then |
439 |
+ bzcat "${ROOT}"var/db/pkg/${CATEGORY}/${PF}/environment.${LOOP_ABI}.bz2 > "${T}"/environment || die |
440 |
+ preprocess_ebuild_env --filter-metadata |
441 |
+ fi |
442 |
+ ;; |
443 |
+ esac |
444 |
+ # >/dev/null = backward compactibility for prerm/postrm |
445 |
+ source "${T}"/environment 2>/dev/null || die |
446 |
+ fi |
447 |
+ export SANDBOX_ON="0" |
448 |
+ if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then |
449 |
+ ebuild_phase_with_hooks pkg_${1} |
450 |
+ else |
451 |
+ set -x |
452 |
+ ebuild_phase_with_hooks pkg_${1} |
453 |
+ set +x |
454 |
+ fi |
455 |
+ |
456 |
+ if [[ $EBUILD_PHASE == postinst ]] && [[ -n $PORTAGE_UPDATE_ENV ]]; then |
457 |
+ # Update environment.bz2 in case installation phases |
458 |
+ # need to pass some variables to uninstallation phases. |
459 |
+ save_ebuild_env --exclude-init-phases | \ |
460 |
+ filter_readonly_variables --filter-path \ |
461 |
+ --filter-sandbox --allow-extra-vars \ |
462 |
+ | ${PORTAGE_BZIP2_COMMAND} -c -f9 > "$PORTAGE_UPDATE_ENV" |
463 |
+ assert "save_ebuild_env failed" |
464 |
+ fi |
465 |
+ if is_auto-multilib ; then |
466 |
+ case ${1} in |
467 |
+ postinst) |
468 |
+ unset_abi |
469 |
+ ;; |
470 |
+ prerm|postrm) |
471 |
+ #if = backward compactibility for previous versions, which did not |
472 |
+ #install a per-ABI environment |
473 |
+ if [[ -f "${ROOT}"var/db/pkg/${CATEGORY}/${PF}/environment.${LOOP_ABI}.bz2 ]] ; then |
474 |
+ preprocess_ebuild_env --filter-metadata |
475 |
+ bzcat "${ROOT}"var/db/pkg/${CATEGORY}/${PF}/environment.${LOOP_ABI}.bz2 > "${T}"/environment || die |
476 |
+ fi |
477 |
+ ;; |
478 |
+ esac |
479 |
+ # >/dev/null = backward compactibility for prerm/postrm |
480 |
+ source "${T}"/environment 2>/dev/null || die |
481 |
+ fi |
482 |
+ done |
483 |
+ else |
484 |
export SANDBOX_ON="0" |
485 |
if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then |
486 |
ebuild_phase_with_hooks pkg_${1} |
487 |
@@ -1061,34 +1126,16 @@ ebuild_main() { |
488 |
ebuild_phase_with_hooks pkg_${1} |
489 |
set +x |
490 |
fi |
491 |
- |
492 |
- if [[ $EBUILD_PHASE == postinst ]] && [[ -n $PORTAGE_UPDATE_ENV ]]; then |
493 |
- # Update environment.bz2 in case installation phases |
494 |
- # need to pass some variables to uninstallation phases. |
495 |
- save_ebuild_env --exclude-init-phases | \ |
496 |
- filter_readonly_variables --filter-path \ |
497 |
- --filter-sandbox --allow-extra-vars \ |
498 |
- | ${PORTAGE_BZIP2_COMMAND} -c -f9 > "$PORTAGE_UPDATE_ENV" |
499 |
- assert "save_ebuild_env failed" |
500 |
- fi |
501 |
- if is_auto-multilib ; then |
502 |
- case ${1} in |
503 |
- postinst) |
504 |
- unset_abi |
505 |
- ;; |
506 |
- prerm|postrm) |
507 |
- #if = backward compactibility for previous versions, which did not |
508 |
- #install a per-ABI environment |
509 |
- if [[ -f "${ROOT}"var/db/pkg/${CATEGORY}/${PF}/environment.${LOOP_ABI}.bz2 ]] ; then |
510 |
- preprocess_ebuild_env --filter-metadata |
511 |
- bzcat "${ROOT}"var/db/pkg/${CATEGORY}/${PF}/environment.${LOOP_ABI}.bz2 > "${T}"/environment || die |
512 |
- fi |
513 |
- ;; |
514 |
- esac |
515 |
- # >/dev/null = backward compactibility for prerm/postrm |
516 |
- source "${T}"/environment 2>/dev/null || die |
517 |
- fi |
518 |
- done |
519 |
+ fi |
520 |
+ if [[ $EBUILD_PHASE == postinst ]] && [[ -n $PORTAGE_UPDATE_ENV ]]; then |
521 |
+ # Update environment.bz2 in case installation phases |
522 |
+ # need to pass some variables to uninstallation phases. |
523 |
+ save_ebuild_env --exclude-init-phases | \ |
524 |
+ filter_readonly_variables --filter-path \ |
525 |
+ --filter-sandbox --allow-extra-vars \ |
526 |
+ | ${PORTAGE_BZIP2_COMMAND} -c -f9 > "$PORTAGE_UPDATE_ENV" |
527 |
+ assert "save_ebuild_env failed" |
528 |
+ fi |
529 |
;; |
530 |
unpack|prepare|configure|compile|test|clean|install) |
531 |
if [[ ${SANDBOX_DISABLED:-0} = 0 ]] ; then |