Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-apps/portage/files/, sys-apps/portage/
Date: Fri, 29 Sep 2017 08:19:13
Message-Id: 1506434754.d9f6cf75e9fc38cb9f4cd7158e9ae19d39585332.haubi@gentoo
1 commit: d9f6cf75e9fc38cb9f4cd7158e9ae19d39585332
2 Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 26 14:05:54 2017 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 26 14:05:54 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d9f6cf75
7
8 sys-apps/portage: bump ebuildshell patch
9
10 The change actually is for FEATURES=userpriv in main Gentoo Linux.
11
12 Package-Manager: Portage-2.3.10-prefix, Repoman-2.3.3
13
14 .../files/portage-2.2.01.18213-ebuildshell.patch | 105 --------------
15 .../files/portage-2.2.01.18980-ebuildshell.patch | 103 --------------
16 .../files/portage-2.2.01.19247-ebuildshell.patch | 105 --------------
17 .../files/portage-2.2.01.19981-ebuildshell.patch | 105 --------------
18 .../files/portage-2.2.01.20020-ebuildshell.patch | 137 ------------------
19 .../files/portage-2.2.01.20239-ebuildshell.patch | 148 -------------------
20 .../portage/files/portage-2.2.7-ebuildshell.patch | 158 ---------------------
21 .../portage/files/portage-2.2.8-ebuildshell.patch | 157 --------------------
22 ...hell.patch => portage-2.3.10-ebuildshell.patch} | 37 ++---
23 sys-apps/portage/portage-2.3.10.ebuild | 2 +-
24 10 files changed, 21 insertions(+), 1036 deletions(-)
25
26 diff --git a/sys-apps/portage/files/portage-2.2.01.18213-ebuildshell.patch b/sys-apps/portage/files/portage-2.2.01.18213-ebuildshell.patch
27 deleted file mode 100644
28 index 59e98af020..0000000000
29 --- a/sys-apps/portage/files/portage-2.2.01.18213-ebuildshell.patch
30 +++ /dev/null
31 @@ -1,105 +0,0 @@
32 -http://bugs.gentoo.org/show_bug.cgi?id=155161
33 -
34 ---- portage/bin/ebuild.sh.orig 2010-12-15 11:12:12.466527126 +0100
35 -+++ portage/bin/ebuild.sh 2010-12-15 11:11:04.757062756 +0100
36 -@@ -59,7 +59,7 @@
37 - qa_call() {
38 - local shopts=$(shopt) OLDIFS="$IFS"
39 - local retval
40 -- "$@"
41 -+ call-ebuildshell "$@"
42 - retval=$?
43 - set +e
44 - [[ $shopts != $(shopt) ]] &&
45 -@@ -1765,7 +1765,7 @@
46 - filter_readonly_variables() {
47 - local x filtered_vars
48 - local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
49 -- FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
50 -+ FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
51 - local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
52 - HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
53 - OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
54 -@@ -1774,8 +1774,10 @@
55 - SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
56 - SANDBOX_LOG SANDBOX_ON"
57 - local misc_garbage_vars="_portage_filter_opts"
58 -- filtered_vars="$readonly_bash_vars $bash_misc_vars
59 -- $PORTAGE_READONLY_VARS $misc_garbage_vars"
60 -+ filtered_vars="$readonly_bash_vars"
61 -+ if ! hasq --filter-for-subshell $* ; then
62 -+ filtered_vars="$filtered_vars $bash_misc_vars $PORTAGE_READONLY_VARS $misc_garbage_vars"
63 -+ fi
64 -
65 - # Don't filter/interfere with prefix variables unless they are
66 - # supported by the current EAPI.
67 -@@ -1805,7 +1807,11 @@
68 - LC_CTYPE LC_MESSAGES LC_MONETARY
69 - LC_NUMERIC LC_PAPER LC_TIME"
70 - fi
71 -- if ! hasq --allow-extra-vars $* ; then
72 -+ if hasq --filter-metadata $* ; then
73 -+ filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
74 -+ fi
75 -+ if ! hasq --allow-extra-vars $* &&
76 -+ ! hasq --filter-for-subshell $* ; then
77 - filtered_vars="
78 - ${filtered_vars}
79 - ${PORTAGE_SAVED_READONLY_VARS}
80 -@@ -1936,6 +1942,56 @@
81 - unset BIN_PATH BIN BODY FUNC_SRC
82 - fi
83 -
84 -+call-ebuildshell() {
85 -+ if ! hasq ebuildshell ${FEATURES}; then
86 -+ "$@"
87 -+ return $?
88 -+ fi
89 -+ (
90 -+ umask 002
91 -+ (
92 -+ (
93 -+ set
94 -+ declare -p
95 -+ declare -fp
96 -+ shopt -p
97 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
98 -+ export
99 -+ fi
100 -+ ) | filter_readonly_variables --filter-for-subshell
101 -+ echo 'declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS'
102 -+ echo "export PS1='EBUILD ${PN} $1 \$ '"
103 -+ echo 'unset ENV'
104 -+ echo "type $1"
105 -+ echo "echo WANTED: $@"
106 -+ echo "trap '"
107 -+ echo "umask 002"
108 -+ echo "("
109 -+ echo " set"
110 -+ echo " declare -p"
111 -+ echo " declare -fp"
112 -+ echo " shopt -p"
113 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
114 -+ echo " export"
115 -+ fi
116 -+ echo -n ")"
117 -+ echo -n " | filter_readonly_variables --filter-metadata"
118 -+ echo " > ${T}/ebuildshell-environment-outcome' 0"
119 -+ ) > ${T}/ebuildshell-environment
120 -+ chown portage:portage "${T}/ebuildshell-environment" &>/dev/null
121 -+ chmod g+w "${T}/ebuildshell-environment" &>/dev/null
122 -+ )
123 -+
124 -+ rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
125 -+
126 -+ unset BASH_ENV
127 -+ env -i ${BASH} --rcfile "${T}/ebuildshell-environment" -i || die
128 -+
129 -+ chown portage:portage "${T}/ebuildshell-environment-outcome" &>/dev/null
130 -+ chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
131 -+ source "${T}/ebuildshell-environment-outcome" &>/dev/null
132 -+}
133 -+
134 - # Subshell/helper die support (must export for the die helper).
135 - export EBUILD_MASTER_PID=$BASHPID
136 - trap 'exit 1' SIGTERM
137
138 diff --git a/sys-apps/portage/files/portage-2.2.01.18980-ebuildshell.patch b/sys-apps/portage/files/portage-2.2.01.18980-ebuildshell.patch
139 deleted file mode 100644
140 index b8911f26a0..0000000000
141 --- a/sys-apps/portage/files/portage-2.2.01.18980-ebuildshell.patch
142 +++ /dev/null
143 @@ -1,103 +0,0 @@
144 ---- prefix-portage-2.2.01.18980/bin/ebuild.sh
145 -+++ prefix-portage-2.2.01.18980/bin/ebuild.sh
146 -@@ -59,7 +59,7 @@
147 - qa_call() {
148 - local shopts=$(shopt) OLDIFS="$IFS"
149 - local retval
150 -- "$@"
151 -+ call-ebuildshell "$@"
152 - retval=$?
153 - set +e
154 - [[ $shopts != $(shopt) ]] &&
155 -@@ -1824,7 +1824,7 @@
156 - filter_readonly_variables() {
157 - local x filtered_vars
158 - local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
159 -- FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
160 -+ FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
161 - local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
162 - HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
163 - OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
164 -@@ -1833,8 +1833,10 @@
165 - SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
166 - SANDBOX_LOG SANDBOX_ON"
167 - local misc_garbage_vars="_portage_filter_opts"
168 -- filtered_vars="$readonly_bash_vars $bash_misc_vars
169 -- $PORTAGE_READONLY_VARS $misc_garbage_vars"
170 -+ filtered_vars="$readonly_bash_vars"
171 -+ if ! has --filter-for-subshell $* ; then
172 -+ filtered_vars="$filtered_vars $bash_misc_vars $PORTAGE_READONLY_VARS $misc_garbage_vars"
173 -+ fi
174 -
175 - # Don't filter/interfere with prefix variables unless they are
176 - # supported by the current EAPI.
177 -@@ -1864,7 +1866,11 @@
178 - LC_CTYPE LC_MESSAGES LC_MONETARY
179 - LC_NUMERIC LC_PAPER LC_TIME"
180 - fi
181 -- if ! has --allow-extra-vars $* ; then
182 -+ if has --filter-metadata $* ; then
183 -+ filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
184 -+ fi
185 -+ if ! has --allow-extra-vars $* &&
186 -+ ! has --filter-for-subshell $* ; then
187 - filtered_vars="
188 - ${filtered_vars}
189 - ${PORTAGE_SAVED_READONLY_VARS}
190 -@@ -1995,6 +2001,56 @@
191 - unset BIN_PATH BIN BODY FUNC_SRC
192 - fi
193 -
194 -+call-ebuildshell() {
195 -+ if ! has ebuildshell ${FEATURES}; then
196 -+ "$@"
197 -+ return $?
198 -+ fi
199 -+ (
200 -+ umask 002
201 -+ (
202 -+ (
203 -+ set
204 -+ declare -p
205 -+ declare -fp
206 -+ shopt -p
207 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
208 -+ export
209 -+ fi
210 -+ ) | filter_readonly_variables --filter-for-subshell
211 -+ echo 'declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS'
212 -+ echo "export PS1='EBUILD ${PN} $1 \$ '"
213 -+ echo 'unset ENV'
214 -+ echo "type $1"
215 -+ echo "echo WANTED: $@"
216 -+ echo "trap '"
217 -+ echo "umask 002"
218 -+ echo "("
219 -+ echo " set"
220 -+ echo " declare -p"
221 -+ echo " declare -fp"
222 -+ echo " shopt -p"
223 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
224 -+ echo " export"
225 -+ fi
226 -+ echo -n ")"
227 -+ echo -n " | filter_readonly_variables --filter-metadata"
228 -+ echo " > ${T}/ebuildshell-environment-outcome' 0"
229 -+ ) > ${T}/ebuildshell-environment
230 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment" &>/dev/null
231 -+ chmod g+w "${T}/ebuildshell-environment" &>/dev/null
232 -+ )
233 -+
234 -+ rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
235 -+
236 -+ unset BASH_ENV
237 -+ env -i ${BASH} --rcfile "${T}/ebuildshell-environment" -i || die
238 -+
239 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment-outcome" &>/dev/null
240 -+ chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
241 -+ source "${T}/ebuildshell-environment-outcome" &>/dev/null
242 -+}
243 -+
244 - # Subshell/helper die support (must export for the die helper).
245 - export EBUILD_MASTER_PID=$BASHPID
246 - trap 'exit 1' SIGTERM
247
248 diff --git a/sys-apps/portage/files/portage-2.2.01.19247-ebuildshell.patch b/sys-apps/portage/files/portage-2.2.01.19247-ebuildshell.patch
249 deleted file mode 100644
250 index 8392b12c82..0000000000
251 --- a/sys-apps/portage/files/portage-2.2.01.19247-ebuildshell.patch
252 +++ /dev/null
253 @@ -1,105 +0,0 @@
254 ---- bin/ebuild.sh.orig 2011-09-16 15:43:36 +0200
255 -+++ bin/ebuild.sh 2011-09-16 15:51:06 +0200
256 -@@ -95,7 +95,7 @@
257 - qa_call() {
258 - local shopts=$(shopt) OLDIFS="$IFS"
259 - local retval
260 -- "$@"
261 -+ call-ebuildshell "$@"
262 - retval=$?
263 - set +e
264 - [[ $shopts != $(shopt) ]] &&
265 -@@ -466,6 +466,56 @@
266 - unset BIN_PATH BIN BODY FUNC_SRC
267 - fi
268 -
269 -+call-ebuildshell() {
270 -+ if ! has ebuildshell ${FEATURES}; then
271 -+ "$@"
272 -+ return $?
273 -+ fi
274 -+ (
275 -+ umask 002
276 -+ (
277 -+ (
278 -+ set
279 -+ declare -p
280 -+ declare -fp
281 -+ shopt -p
282 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
283 -+ export
284 -+ fi
285 -+ ) | filter_readonly_variables --filter-for-subshell
286 -+ echo 'declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS'
287 -+ echo "export PS1='EBUILD ${PN} $1 \$ '"
288 -+ echo 'unset ENV'
289 -+ echo "type $1"
290 -+ echo "echo WANTED: $@"
291 -+ echo "trap '"
292 -+ echo "umask 002"
293 -+ echo "("
294 -+ echo " set"
295 -+ echo " declare -p"
296 -+ echo " declare -fp"
297 -+ echo " shopt -p"
298 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
299 -+ echo " export"
300 -+ fi
301 -+ echo -n ")"
302 -+ echo -n " | filter_readonly_variables --filter-metadata"
303 -+ echo " > ${T}/ebuildshell-environment-outcome' 0"
304 -+ ) > ${T}/ebuildshell-environment
305 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment" &>/dev/null
306 -+ chmod g+w "${T}/ebuildshell-environment" &>/dev/null
307 -+ )
308 -+
309 -+ rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
310 -+
311 -+ unset BASH_ENV
312 -+ env -i ${BASH} --rcfile "${T}/ebuildshell-environment" -i || die
313 -+
314 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment-outcome" &>/dev/null
315 -+ chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
316 -+ source "${T}/ebuildshell-environment-outcome" &>/dev/null
317 -+}
318 -+
319 - # Subshell/helper die support (must export for the die helper).
320 - export EBUILD_MASTER_PID=$BASHPID
321 - trap 'exit 1' SIGTERM
322 ---- bin/phase-functions.sh.orig 2011-09-16 15:45:37 +0200
323 -+++ bin/phase-functions.sh 2011-09-16 15:50:10 +0200
324 -@@ -81,7 +81,7 @@
325 - filter_readonly_variables() {
326 - local x filtered_vars
327 - local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
328 -- FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
329 -+ FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
330 - local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
331 - HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
332 - OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
333 -@@ -90,8 +90,10 @@
334 - SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
335 - SANDBOX_LOG SANDBOX_ON"
336 - local misc_garbage_vars="_portage_filter_opts"
337 -- filtered_vars="$readonly_bash_vars $bash_misc_vars
338 -- $PORTAGE_READONLY_VARS $misc_garbage_vars"
339 -+ filtered_vars="$readonly_bash_vars"
340 -+ if ! has --filter-for-subshell $* ; then
341 -+ filtered_vars="$filtered_vars $bash_misc_vars $PORTAGE_READONLY_VARS $misc_garbage_vars"
342 -+ fi
343 -
344 - # Don't filter/interfere with prefix variables unless they are
345 - # supported by the current EAPI.
346 -@@ -121,7 +123,11 @@
347 - LC_CTYPE LC_MESSAGES LC_MONETARY
348 - LC_NUMERIC LC_PAPER LC_TIME"
349 - fi
350 -- if ! has --allow-extra-vars $* ; then
351 -+ if has --filter-metadata $* ; then
352 -+ filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
353 -+ fi
354 -+ if ! has --allow-extra-vars $* &&
355 -+ ! has --filter-for-subshell $* ; then
356 - filtered_vars="
357 - ${filtered_vars}
358 - ${PORTAGE_SAVED_READONLY_VARS}
359
360 diff --git a/sys-apps/portage/files/portage-2.2.01.19981-ebuildshell.patch b/sys-apps/portage/files/portage-2.2.01.19981-ebuildshell.patch
361 deleted file mode 100644
362 index 63c9d54372..0000000000
363 --- a/sys-apps/portage/files/portage-2.2.01.19981-ebuildshell.patch
364 +++ /dev/null
365 @@ -1,105 +0,0 @@
366 ---- bin/ebuild.sh.orig 2011-09-16 15:43:36 +0200
367 -+++ bin/ebuild.sh 2011-09-16 15:51:06 +0200
368 -@@ -95,7 +95,7 @@
369 - qa_call() {
370 - local shopts=$(shopt) OLDIFS="$IFS"
371 - local retval
372 -- "$@"
373 -+ call-ebuildshell "$@"
374 - retval=$?
375 - set +e
376 - [[ $shopts != $(shopt) ]] &&
377 -@@ -466,6 +466,56 @@
378 - unset BIN_PATH BIN BODY FUNC_SRC
379 - fi
380 -
381 -+call-ebuildshell() {
382 -+ if ! has ebuildshell ${FEATURES}; then
383 -+ "$@"
384 -+ return $?
385 -+ fi
386 -+ (
387 -+ umask 002
388 -+ (
389 -+ (
390 -+ set
391 -+ declare -p
392 -+ declare -fp
393 -+ shopt -p
394 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
395 -+ export
396 -+ fi
397 -+ ) | filter_readonly_variables --filter-for-subshell
398 -+ echo 'declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS'
399 -+ echo "export PS1='EBUILD ${PN} $1 \$ '"
400 -+ echo 'unset ENV'
401 -+ echo "type $1"
402 -+ echo "echo WANTED: $@"
403 -+ echo "trap '"
404 -+ echo "umask 002"
405 -+ echo "("
406 -+ echo " set"
407 -+ echo " declare -p"
408 -+ echo " declare -fp"
409 -+ echo " shopt -p"
410 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
411 -+ echo " export"
412 -+ fi
413 -+ echo -n ")"
414 -+ echo -n " | filter_readonly_variables --filter-metadata"
415 -+ echo " > ${T}/ebuildshell-environment-outcome' 0"
416 -+ ) > ${T}/ebuildshell-environment
417 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment" &>/dev/null
418 -+ chmod g+w "${T}/ebuildshell-environment" &>/dev/null
419 -+ )
420 -+
421 -+ rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
422 -+
423 -+ unset BASH_ENV
424 -+ env -i ${BASH} --rcfile "${T}/ebuildshell-environment" -i || die
425 -+
426 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment-outcome" &>/dev/null
427 -+ chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
428 -+ source "${T}/ebuildshell-environment-outcome" &>/dev/null
429 -+}
430 -+
431 - # Subshell/helper die support (must export for the die helper).
432 - export EBUILD_MASTER_PID=$BASHPID
433 - trap 'exit 1' SIGTERM
434 ---- bin/phase-functions.sh.orig 2011-09-16 15:45:37 +0200
435 -+++ bin/phase-functions.sh 2011-09-16 15:50:10 +0200
436 -@@ -81,7 +81,7 @@
437 - filter_readonly_variables() {
438 - local x filtered_vars
439 - local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
440 -- FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
441 -+ FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
442 - local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
443 - HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
444 - OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
445 -@@ -90,8 +90,10 @@
446 - SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
447 - SANDBOX_LOG SANDBOX_ON"
448 - local misc_garbage_vars="_portage_filter_opts"
449 -- filtered_vars="$readonly_bash_vars $bash_misc_vars
450 -- $PORTAGE_READONLY_VARS $misc_garbage_vars"
451 -+ filtered_vars="$readonly_bash_vars"
452 -+ if ! has --filter-for-subshell $* ; then
453 -+ filtered_vars="$filtered_vars $bash_misc_vars $PORTAGE_READONLY_VARS $misc_garbage_vars"
454 -+ fi
455 -
456 - # Don't filter/interfere with prefix variables unless they are
457 - # supported by the current EAPI.
458 -@@ -121,7 +123,11 @@
459 - LC_CTYPE LC_MESSAGES LC_MONETARY
460 - LC_NUMERIC LC_PAPER LC_TIME"
461 - fi
462 -- if ! has --allow-extra-vars $* ; then
463 -+ if has --filter-metadata $* ; then
464 -+ filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
465 -+ fi
466 -+ if ! has --allow-extra-vars $* &&
467 -+ ! has --filter-for-subshell $* ; then
468 - filtered_vars="
469 - ${filtered_vars}
470 - ${PORTAGE_SAVED_READONLY_VARS}
471
472 diff --git a/sys-apps/portage/files/portage-2.2.01.20020-ebuildshell.patch b/sys-apps/portage/files/portage-2.2.01.20020-ebuildshell.patch
473 deleted file mode 100644
474 index 03eaa24893..0000000000
475 --- a/sys-apps/portage/files/portage-2.2.01.20020-ebuildshell.patch
476 +++ /dev/null
477 @@ -1,137 +0,0 @@
478 -# HG changeset patch
479 -# User Fabian Groffen <grobian@g.o>
480 -# Date 1324637719 -3600
481 -# Node ID d70f677c2c1293d45e51a7f0e3b97b5e2b2900e7
482 -# Parent e7a44acf78b8678781b5d24a90d96d1a53601b41
483 -https://bugs.gentoo.org/155161
484 -
485 -FEATURES=ebuildshell emerge xxxxx
486 -
487 -results in an interactive shell for each function portage calls from the
488 -ebuild, where all functionality is available as in the ebuild
489 -(src_unpack, epatch, etc.). This allows for convenient debugging of
490 -ebuild issues.
491 -
492 -diff -r e7a44acf78b8 -r d70f677c2c12 bin/ebuild.sh
493 ---- a/bin/ebuild.sh Fri Dec 23 11:24:27 2011 +0100
494 -+++ b/bin/ebuild.sh Fri Dec 23 11:55:19 2011 +0100
495 -@@ -82,7 +82,7 @@
496 - qa_call() {
497 - local shopts=$(shopt) OLDIFS="$IFS"
498 - local retval
499 -- "$@"
500 -+ call-ebuildshell "$@"
501 - retval=$?
502 - set +e
503 - [[ $shopts != $(shopt) ]] &&
504 -@@ -453,6 +453,56 @@
505 - unset BIN_PATH BIN BODY FUNC_SRC
506 - fi
507 -
508 -+call-ebuildshell() {
509 -+ if ! has ebuildshell ${FEATURES}; then
510 -+ "$@"
511 -+ return $?
512 -+ fi
513 -+ (
514 -+ umask 002
515 -+ (
516 -+ (
517 -+ set
518 -+ declare -p
519 -+ declare -fp
520 -+ shopt -p
521 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
522 -+ export
523 -+ fi
524 -+ ) | filter_readonly_variables --filter-for-subshell
525 -+ echo 'declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS'
526 -+ echo "export PS1='EBUILD ${PN} $1 \$ '"
527 -+ echo 'unset ENV'
528 -+ echo "type $1"
529 -+ echo "echo WANTED: $@"
530 -+ echo "trap '"
531 -+ echo "umask 002"
532 -+ echo "("
533 -+ echo " set"
534 -+ echo " declare -p"
535 -+ echo " declare -fp"
536 -+ echo " shopt -p"
537 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
538 -+ echo " export"
539 -+ fi
540 -+ echo -n ")"
541 -+ echo -n " | filter_readonly_variables --filter-metadata"
542 -+ echo " > ${T}/ebuildshell-environment-outcome' 0"
543 -+ ) > ${T}/ebuildshell-environment
544 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment" &>/dev/null
545 -+ chmod g+w "${T}/ebuildshell-environment" &>/dev/null
546 -+ )
547 -+
548 -+ rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
549 -+
550 -+ unset BASH_ENV
551 -+ env -i ${BASH} --rcfile "${T}/ebuildshell-environment" -i || die
552 -+
553 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment-outcome" &>/dev/null
554 -+ chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
555 -+ source "${T}/ebuildshell-environment-outcome" &>/dev/null
556 -+}
557 -+
558 - # Subshell/helper die support (must export for the die helper).
559 - export EBUILD_MASTER_PID=$BASHPID
560 - trap 'exit 1' SIGTERM
561 -diff -r e7a44acf78b8 -r d70f677c2c12 bin/phase-functions.sh
562 ---- a/bin/phase-functions.sh Fri Dec 23 11:24:27 2011 +0100
563 -+++ b/bin/phase-functions.sh Fri Dec 23 11:55:19 2011 +0100
564 -@@ -84,7 +84,7 @@
565 - filter_readonly_variables() {
566 - local x filtered_vars
567 - local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
568 -- FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
569 -+ FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
570 - local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
571 - HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
572 - OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
573 -@@ -95,8 +95,10 @@
574 - # Untrusted due to possible application of package renames to binpkgs
575 - local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
576 - local misc_garbage_vars="_portage_filter_opts"
577 -- filtered_vars="$readonly_bash_vars $bash_misc_vars
578 -- $PORTAGE_READONLY_VARS $misc_garbage_vars"
579 -+ filtered_vars="$readonly_bash_vars"
580 -+ if ! has --filter-for-subshell $* ; then
581 -+ filtered_vars="$filtered_vars $bash_misc_vars $PORTAGE_READONLY_VARS $misc_garbage_vars"
582 -+ fi
583 -
584 - # Don't filter/interfere with prefix variables unless they are
585 - # supported by the current EAPI.
586 -@@ -126,7 +128,11 @@
587 - LC_CTYPE LC_MESSAGES LC_MONETARY
588 - LC_NUMERIC LC_PAPER LC_TIME"
589 - fi
590 -- if ! has --allow-extra-vars $* ; then
591 -+ if has --filter-metadata $* ; then
592 -+ filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
593 -+ fi
594 -+ if ! has --allow-extra-vars $* &&
595 -+ ! has --filter-for-subshell $* ; then
596 - if [ "${EMERGE_FROM}" = binary ] ; then
597 - # preserve additional variables from build time,
598 - # while excluding untrusted variables
599 -diff -r e7a44acf78b8 -r d70f677c2c12 man/make.conf.5
600 ---- a/man/make.conf.5 Fri Dec 23 11:24:27 2011 +0100
601 -+++ b/man/make.conf.5 Fri Dec 23 11:55:19 2011 +0100
602 -@@ -287,6 +287,12 @@
603 - Use locks to ensure that unsandboxed ebuild phases never execute
604 - concurrently. Also see \fIparallel\-install\fR.
605 - .TP
606 -+.B ebuildshell
607 -+Drop into an interactive shell for each phase function, meant for
608 -+debugging. Because the shell would normally be used to execute the
609 -+phase function, commands like src_unpack or epatch are available in the
610 -+interactive shell. Use `exit 1` to terminate the merge.
611 -+.TP
612 - .B fakeroot
613 - Enable fakeroot for the install and package phases when a non-root user runs
614 - the \fBebuild\fR(1) command.
615
616 diff --git a/sys-apps/portage/files/portage-2.2.01.20239-ebuildshell.patch b/sys-apps/portage/files/portage-2.2.01.20239-ebuildshell.patch
617 deleted file mode 100644
618 index 9ccc1e5b18..0000000000
619 --- a/sys-apps/portage/files/portage-2.2.01.20239-ebuildshell.patch
620 +++ /dev/null
621 @@ -1,148 +0,0 @@
622 -# HG changeset patch
623 -# User Michael Haubenwallner <haubi@g.o>
624 -# Date 1330634734 -3600
625 -# Node ID 6780ee2ddb337bbd8b4b2681615de7e78e6fb8c1
626 -# Parent 04da3d4d44af4fd2096316f8e1bbb7a998011040
627 -https://bugs.gentoo.org/155161
628 -
629 -FEATURES=ebuildshell emerge xxxxx
630 -
631 -results in an interactive shell for each function portage calls from the
632 -ebuild, where all functionality is available as in the ebuild
633 -(src_unpack, epatch, etc.). This allows for convenient debugging of
634 -ebuild issues.
635 -
636 -diff -r 04da3d4d44af -r 6780ee2ddb33 bin/ebuild.sh
637 ---- a/bin/ebuild.sh Thu Mar 01 21:31:12 2012 +0100
638 -+++ b/bin/ebuild.sh Thu Mar 01 21:45:34 2012 +0100
639 -@@ -82,7 +82,7 @@
640 - qa_call() {
641 - local shopts=$(shopt) OLDIFS="$IFS"
642 - local retval
643 -- "$@"
644 -+ call-ebuildshell "$@"
645 - retval=$?
646 - set +e
647 - [[ $shopts != $(shopt) ]] &&
648 -@@ -453,6 +453,56 @@
649 - unset BIN_PATH BIN BODY FUNC_SRC
650 - fi
651 -
652 -+call-ebuildshell() {
653 -+ if ! has ebuildshell ${FEATURES}; then
654 -+ "$@"
655 -+ return $?
656 -+ fi
657 -+ (
658 -+ umask 002
659 -+ (
660 -+ (
661 -+ set
662 -+ declare -p
663 -+ declare -fp
664 -+ shopt -p
665 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
666 -+ export
667 -+ fi
668 -+ ) | filter_readonly_variables --filter-for-subshell
669 -+ echo 'declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS'
670 -+ echo "export PS1='EBUILD ${PN} $1 \$ '"
671 -+ echo 'unset ENV'
672 -+ echo "type $1"
673 -+ echo "echo WANTED: $@"
674 -+ echo "trap '"
675 -+ echo "umask 002"
676 -+ echo "("
677 -+ echo " set"
678 -+ echo " declare -p"
679 -+ echo " declare -fp"
680 -+ echo " shopt -p"
681 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
682 -+ echo " export"
683 -+ fi
684 -+ echo -n ")"
685 -+ echo -n " | filter_readonly_variables --filter-metadata"
686 -+ echo " > ${T}/ebuildshell-environment-outcome' 0"
687 -+ ) > ${T}/ebuildshell-environment
688 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment" &>/dev/null
689 -+ chmod g+w "${T}/ebuildshell-environment" &>/dev/null
690 -+ )
691 -+
692 -+ rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
693 -+
694 -+ unset BASH_ENV
695 -+ env -i ${BASH} --rcfile "${T}/ebuildshell-environment" -i || die
696 -+
697 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment-outcome" &>/dev/null
698 -+ chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
699 -+ source "${T}/ebuildshell-environment-outcome" &>/dev/null
700 -+}
701 -+
702 - # Subshell/helper die support (must export for the die helper).
703 - export EBUILD_MASTER_PID=$BASHPID
704 - trap 'exit 1' SIGTERM
705 -diff -r 04da3d4d44af -r 6780ee2ddb33 bin/phase-functions.sh
706 ---- a/bin/phase-functions.sh Thu Mar 01 21:31:12 2012 +0100
707 -+++ b/bin/phase-functions.sh Thu Mar 01 21:45:34 2012 +0100
708 -@@ -84,7 +84,7 @@
709 - filter_readonly_variables() {
710 - local x filtered_vars
711 - local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
712 -- FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
713 -+ FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
714 - local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
715 - HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
716 - OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
717 -@@ -95,8 +95,10 @@
718 - # Untrusted due to possible application of package renames to binpkgs
719 - local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
720 - local misc_garbage_vars="_portage_filter_opts"
721 -- filtered_vars="$readonly_bash_vars $bash_misc_vars
722 -- $PORTAGE_READONLY_VARS $misc_garbage_vars"
723 -+ filtered_vars="$readonly_bash_vars"
724 -+ if ! has --filter-for-subshell $* ; then
725 -+ filtered_vars="$filtered_vars $bash_misc_vars $PORTAGE_READONLY_VARS $misc_garbage_vars"
726 -+ fi
727 -
728 - # Don't filter/interfere with prefix variables unless they are
729 - # supported by the current EAPI.
730 -@@ -126,7 +128,11 @@
731 - LC_CTYPE LC_MESSAGES LC_MONETARY
732 - LC_NUMERIC LC_PAPER LC_TIME"
733 - fi
734 -- if ! has --allow-extra-vars $* ; then
735 -+ if has --filter-metadata $* ; then
736 -+ filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
737 -+ fi
738 -+ if ! has --allow-extra-vars $* &&
739 -+ ! has --filter-for-subshell $* ; then
740 - if [ "${EMERGE_FROM}" = binary ] ; then
741 - # preserve additional variables from build time,
742 - # while excluding untrusted variables
743 -diff -r 04da3d4d44af -r 6780ee2ddb33 man/make.conf.5
744 ---- a/man/make.conf.5 Thu Mar 01 21:31:12 2012 +0100
745 -+++ b/man/make.conf.5 Thu Mar 01 21:45:34 2012 +0100
746 -@@ -297,6 +297,12 @@
747 - Use locks to ensure that unsandboxed ebuild phases never execute
748 - concurrently. Also see \fIparallel\-install\fR.
749 - .TP
750 -+.B ebuildshell
751 -+Drop into an interactive shell for each phase function, meant for
752 -+debugging. Because the shell would normally be used to execute the
753 -+phase function, commands like src_unpack or epatch are available in the
754 -+interactive shell. Use `exit 1` to terminate the merge.
755 -+.TP
756 - .B fakeroot
757 - Enable fakeroot for the install and package phases when a non-root user runs
758 - the \fBebuild\fR(1) command.
759 -diff -r 04da3d4d44af -r 6780ee2ddb33 pym/_emerge/AbstractEbuildProcess.py
760 ---- a/pym/_emerge/AbstractEbuildProcess.py Thu Mar 01 21:31:12 2012 +0100
761 -+++ b/pym/_emerge/AbstractEbuildProcess.py Thu Mar 01 21:45:34 2012 +0100
762 -@@ -97,6 +97,7 @@
763 - self.fd_pipes = {}
764 - null_fd = None
765 - if 0 not in self.fd_pipes and \
766 -+ "ebuildshell" not in self.settings.features and \
767 - self.phase not in self._phases_interactive_whitelist and \
768 - "interactive" not in self.settings.get("PROPERTIES", "").split():
769 - null_fd = os.open('/dev/null', os.O_RDONLY)
770
771 diff --git a/sys-apps/portage/files/portage-2.2.7-ebuildshell.patch b/sys-apps/portage/files/portage-2.2.7-ebuildshell.patch
772 deleted file mode 100644
773 index 5c8cec81f7..0000000000
774 --- a/sys-apps/portage/files/portage-2.2.7-ebuildshell.patch
775 +++ /dev/null
776 @@ -1,158 +0,0 @@
777 -diff --git a/bin/ebuild.sh b/bin/ebuild.sh
778 -index 35f4b91..8e702d0 100755
779 ---- a/bin/ebuild.sh
780 -+++ b/bin/ebuild.sh
781 -@@ -90,7 +90,7 @@ __qa_source() {
782 - __qa_call() {
783 - local shopts=$(shopt) OLDIFS="$IFS"
784 - local retval
785 -- "$@"
786 -+ __call-ebuildshell "$@"
787 - retval=$?
788 - set +e
789 - [[ $shopts != $(shopt) ]] &&
790 -@@ -467,6 +467,58 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
791 - unset BIN_PATH BIN BODY FUNC_SRC
792 - fi
793 -
794 -+__call-ebuildshell() {
795 -+ if ! has ebuildshell ${FEATURES}; then
796 -+ "$@"
797 -+ return $?
798 -+ fi
799 -+ (
800 -+ umask 002
801 -+ (
802 -+ (
803 -+ set
804 -+ declare -p
805 -+ declare -fp
806 -+ shopt -p
807 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
808 -+ export
809 -+ fi
810 -+ ) | __filter_readonly_variables --filter-for-subshell
811 -+ echo 'declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS'
812 -+ echo "export PS1='EBUILD ${PN} $1 \$ '"
813 -+ echo 'unset ENV'
814 -+ echo "type $1"
815 -+ echo "echo WANTED: $@"
816 -+ echo "trap '"
817 -+ echo "umask 002"
818 -+ echo "("
819 -+ echo " set"
820 -+ echo " declare -p"
821 -+ echo " declare -fp"
822 -+ echo " shopt -p | grep -v extdebug$"
823 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
824 -+ echo " export"
825 -+ fi
826 -+ echo -n ")"
827 -+ echo -n " | __filter_readonly_variables --filter-metadata"
828 -+ echo " > ${T}/ebuildshell-environment-outcome' 0"
829 -+ echo "shopt -u extdebug"
830 -+ echo "trap - DEBUG"
831 -+ ) > ${T}/ebuildshell-environment
832 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment" &>/dev/null
833 -+ chmod g+w "${T}/ebuildshell-environment" &>/dev/null
834 -+ )
835 -+
836 -+ rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
837 -+
838 -+ unset BASH_ENV
839 -+ env -i ${BASH} --rcfile "${T}/ebuildshell-environment" -i || die
840 -+
841 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment-outcome" &>/dev/null
842 -+ chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
843 -+ source "${T}/ebuildshell-environment-outcome" &>/dev/null
844 -+}
845 -+
846 - # Subshell/helper die support (must export for the die helper).
847 - export EBUILD_MASTER_PID=$BASHPID
848 - trap 'exit 1' SIGTERM
849 -diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
850 -index 711b721..5f3a8a2 100644
851 ---- a/bin/phase-functions.sh
852 -+++ b/bin/phase-functions.sh
853 -@@ -87,7 +87,7 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
854 - __filter_readonly_variables() {
855 - local x filtered_vars
856 - local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
857 -- FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
858 -+ FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
859 - local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
860 - HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
861 - OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
862 -@@ -98,12 +98,14 @@ __filter_readonly_variables() {
863 - # Untrusted due to possible application of package renames to binpkgs
864 - local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
865 - local misc_garbage_vars="_portage_filter_opts"
866 -- filtered_vars="$readonly_bash_vars $bash_misc_vars
867 -- $PORTAGE_READONLY_VARS $misc_garbage_vars"
868 -+ filtered_vars="$readonly_bash_vars"
869 -+ if ! has --filter-for-subshell $* ; then
870 -+ filtered_vars="$filtered_vars $bash_misc_vars $PORTAGE_READONLY_VARS $misc_garbage_vars"
871 -+ fi
872 -
873 - # Don't filter/interfere with prefix variables unless they are
874 - # supported by the current EAPI.
875 -- if ___eapi_has_prefix_variables; then
876 -+ if ___eapi_has_prefix_variables && ! has --filter-for-subshell $* ; then
877 - filtered_vars+=" ED EPREFIX EROOT"
878 - fi
879 -
880 -@@ -123,7 +125,11 @@ __filter_readonly_variables() {
881 - LC_CTYPE LC_MESSAGES LC_MONETARY
882 - LC_NUMERIC LC_PAPER LC_TIME"
883 - fi
884 -- if ! has --allow-extra-vars $* ; then
885 -+ if has --filter-metadata $* ; then
886 -+ filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
887 -+ fi
888 -+ if ! has --allow-extra-vars $* &&
889 -+ ! has --filter-for-subshell $* ; then
890 - if [ "${EMERGE_FROM}" = binary ] ; then
891 - # preserve additional variables from build time,
892 - # while excluding untrusted variables
893 -diff --git a/man/make.conf.5 b/man/make.conf.5
894 -index ab9b44e..45903e3 100644
895 ---- a/man/make.conf.5
896 -+++ b/man/make.conf.5
897 -@@ -345,6 +345,12 @@ exist). Also see the related \fIunmerge\-backup\fR feature.
898 - Use locks to ensure that unsandboxed ebuild phases never execute
899 - concurrently. Also see \fIparallel\-install\fR.
900 - .TP
901 -+.B ebuildshell
902 -+Drop into an interactive shell for each phase function, meant for
903 -+debugging. Because the shell would normally be used to execute the
904 -+phase function, commands like src_unpack or epatch are available in the
905 -+interactive shell. Use `exit 1` to terminate the merge.
906 -+.TP
907 - .B fakeroot
908 - Enable fakeroot for the install and package phases when a non-root user runs
909 - the \fBebuild\fR(1) command.
910 -diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
911 -index 31127f4..73031d0 100644
912 ---- a/pym/_emerge/AbstractEbuildProcess.py
913 -+++ b/pym/_emerge/AbstractEbuildProcess.py
914 -@@ -136,6 +136,7 @@ class AbstractEbuildProcess(SpawnProcess):
915 - self.fd_pipes = {}
916 - null_fd = None
917 - if 0 not in self.fd_pipes and \
918 -+ "ebuildshell" not in self.settings.features and \
919 - self.phase not in self._phases_interactive_whitelist and \
920 - "interactive" not in self.settings.get("PROPERTIES", "").split():
921 - null_fd = os.open('/dev/null', os.O_RDONLY)
922 -diff --git a/pym/portage/const.py b/pym/portage/const.py
923 -index 214ede4..725a7d0 100644
924 ---- a/pym/portage/const.py
925 -+++ b/pym/portage/const.py
926 -@@ -100,7 +100,7 @@ SUPPORTED_FEATURES = frozenset([
927 - "collision-protect", "compress-build-logs", "compressdebug",
928 - "compress-index", "config-protect-if-modified",
929 - "digest", "distcc", "distcc-pump", "distlocks",
930 -- "downgrade-backup", "ebuild-locks", "fakeroot",
931 -+ "downgrade-backup", "ebuildshell", "ebuild-locks", "fakeroot",
932 - "fail-clean", "force-mirror", "force-prefix", "getbinpkg",
933 - "installsources", "ipc-sandbox",
934 - "keeptemp", "keepwork", "fixlafiles", "lmirror",
935
936 diff --git a/sys-apps/portage/files/portage-2.2.8-ebuildshell.patch b/sys-apps/portage/files/portage-2.2.8-ebuildshell.patch
937 deleted file mode 100644
938 index 82219eb7f9..0000000000
939 --- a/sys-apps/portage/files/portage-2.2.8-ebuildshell.patch
940 +++ /dev/null
941 @@ -1,157 +0,0 @@
942 -diff --git a/bin/ebuild.sh b/bin/ebuild.sh
943 -index 35f4b91..8e702d0 100755
944 ---- a/bin/ebuild.sh
945 -+++ b/bin/ebuild.sh
946 -@@ -90,7 +90,7 @@
947 - __qa_call() {
948 - local shopts=$(shopt) OLDIFS="$IFS"
949 - local retval
950 -- "$@"
951 -+ __call-ebuildshell "$@"
952 - retval=$?
953 - set +e
954 - [[ $shopts != $(shopt) ]] &&
955 -@@ -467,6 +467,58 @@
956 - unset BIN_PATH BIN BODY FUNC_SRC
957 - fi
958 -
959 -+__call-ebuildshell() {
960 -+ if ! has ebuildshell ${FEATURES}; then
961 -+ "$@"
962 -+ return $?
963 -+ fi
964 -+ (
965 -+ umask 002
966 -+ (
967 -+ (
968 -+ set
969 -+ declare -p
970 -+ declare -fp
971 -+ shopt -p
972 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
973 -+ export
974 -+ fi
975 -+ ) | __filter_readonly_variables --filter-for-subshell
976 -+ echo 'declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS'
977 -+ echo "export PS1='EBUILD ${PN} $1 \$ '"
978 -+ echo 'unset ENV'
979 -+ echo "type $1"
980 -+ echo "echo WANTED: $@"
981 -+ echo "trap '"
982 -+ echo "umask 002"
983 -+ echo "("
984 -+ echo " set"
985 -+ echo " declare -p"
986 -+ echo " declare -fp"
987 -+ echo " shopt -p | grep -v extdebug$"
988 -+ if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
989 -+ echo " export"
990 -+ fi
991 -+ echo -n ")"
992 -+ echo -n " | __filter_readonly_variables --filter-metadata"
993 -+ echo " > ${T}/ebuildshell-environment-outcome' 0"
994 -+ echo "shopt -u extdebug"
995 -+ echo "trap - DEBUG"
996 -+ ) > ${T}/ebuildshell-environment
997 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment" &>/dev/null
998 -+ chmod g+w "${T}/ebuildshell-environment" &>/dev/null
999 -+ )
1000 -+
1001 -+ rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
1002 -+
1003 -+ unset BASH_ENV
1004 -+ env -i ${BASH} --rcfile "${T}/ebuildshell-environment" -i || die
1005 -+
1006 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment-outcome" &>/dev/null
1007 -+ chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
1008 -+ source "${T}/ebuildshell-environment-outcome" &>/dev/null
1009 -+}
1010 -+
1011 - # Subshell/helper die support (must export for the die helper).
1012 - export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
1013 - trap 'exit 1' SIGTERM
1014 -diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
1015 -index 711b721..5f3a8a2 100644
1016 ---- a/bin/phase-functions.sh
1017 -+++ b/bin/phase-functions.sh
1018 -@@ -87,7 +87,7 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
1019 - __filter_readonly_variables() {
1020 - local x filtered_vars
1021 - local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
1022 -- FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
1023 -+ FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
1024 - local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
1025 - HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
1026 - OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
1027 -@@ -98,12 +98,14 @@ __filter_readonly_variables() {
1028 - # Untrusted due to possible application of package renames to binpkgs
1029 - local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
1030 - local misc_garbage_vars="_portage_filter_opts"
1031 -- filtered_vars="$readonly_bash_vars $bash_misc_vars
1032 -- $PORTAGE_READONLY_VARS $misc_garbage_vars"
1033 -+ filtered_vars="$readonly_bash_vars"
1034 -+ if ! has --filter-for-subshell $* ; then
1035 -+ filtered_vars="$filtered_vars $bash_misc_vars $PORTAGE_READONLY_VARS $misc_garbage_vars"
1036 -+ fi
1037 -
1038 - # Don't filter/interfere with prefix variables unless they are
1039 - # supported by the current EAPI.
1040 -- if ___eapi_has_prefix_variables; then
1041 -+ if ___eapi_has_prefix_variables && ! has --filter-for-subshell $* ; then
1042 - filtered_vars+=" ED EPREFIX EROOT"
1043 - fi
1044 -
1045 -@@ -123,7 +125,11 @@ __filter_readonly_variables() {
1046 - LC_CTYPE LC_MESSAGES LC_MONETARY
1047 - LC_NUMERIC LC_PAPER LC_TIME"
1048 - fi
1049 -- if ! has --allow-extra-vars $* ; then
1050 -+ if has --filter-metadata $* ; then
1051 -+ filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
1052 -+ fi
1053 -+ if ! has --allow-extra-vars $* &&
1054 -+ ! has --filter-for-subshell $* ; then
1055 - if [ "${EMERGE_FROM}" = binary ] ; then
1056 - # preserve additional variables from build time,
1057 - # while excluding untrusted variables
1058 -diff --git a/man/make.conf.5 b/man/make.conf.5
1059 -index ab9b44e..45903e3 100644
1060 ---- a/man/make.conf.5
1061 -+++ b/man/make.conf.5
1062 -@@ -346,6 +346,12 @@
1063 - Use locks to ensure that unsandboxed ebuild phases never execute
1064 - concurrently. Also see \fIparallel\-install\fR.
1065 - .TP
1066 -+.B ebuildshell
1067 -+Drop into an interactive shell for each phase function, meant for
1068 -+debugging. Because the shell would normally be used to execute the
1069 -+phase function, commands like src_unpack or epatch are available in the
1070 -+interactive shell. Use `exit 1` to terminate the merge.
1071 -+.TP
1072 - .B fakeroot
1073 - Enable fakeroot for the install and package phases when a non-root user runs
1074 - the \fBebuild\fR(1) command.
1075 -diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
1076 -index 31127f4..73031d0 100644
1077 ---- a/pym/_emerge/AbstractEbuildProcess.py
1078 -+++ b/pym/_emerge/AbstractEbuildProcess.py
1079 -@@ -136,6 +136,7 @@ class AbstractEbuildProcess(SpawnProcess):
1080 - self.fd_pipes = {}
1081 - null_fd = None
1082 - if 0 not in self.fd_pipes and \
1083 -+ "ebuildshell" not in self.settings.features and \
1084 - self.phase not in self._phases_interactive_whitelist and \
1085 - "interactive" not in self.settings.get("PROPERTIES", "").split():
1086 - null_fd = os.open('/dev/null', os.O_RDONLY)
1087 -diff --git a/pym/portage/const.py b/pym/portage/const.py
1088 -index 214ede4..725a7d0 100644
1089 ---- a/pym/portage/const.py
1090 -+++ b/pym/portage/const.py
1091 -@@ -139,6 +139,7 @@ SUPPORTED_FEATURES = frozenset([
1092 - "distlocks",
1093 - "downgrade-backup",
1094 - "ebuild-locks",
1095 -+ "ebuildshell",
1096 - "fail-clean",
1097 - "fakeroot",
1098 - "fixlafiles",
1099
1100 diff --git a/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch b/sys-apps/portage/files/portage-2.3.10-ebuildshell.patch
1101 similarity index 92%
1102 rename from sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
1103 rename to sys-apps/portage/files/portage-2.3.10-ebuildshell.patch
1104 index 4674506d98..d0381a0696 100644
1105 --- a/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
1106 +++ b/sys-apps/portage/files/portage-2.3.10-ebuildshell.patch
1107 @@ -1,22 +1,22 @@
1108 -From 5e3167845640624f328969355db2e7f16cad2c83 Mon Sep 17 00:00:00 2001
1109 +From 05a16e4c910f7dc053358d8519c6708d3a4b14ca Mon Sep 17 00:00:00 2001
1110 From: Michael Haubenwallner <michael.haubenwallner@×××××××.at>
1111 Date: Wed, 6 Nov 2013 12:40:05 +0100
1112 Subject: [PATCH] Add ebuildshell feature, bug#155161.
1113
1114 ---
1115 - bin/ebuild.sh | 143 ++++++++++++++++++++++++++++++++++-
1116 + bin/ebuild.sh | 146 ++++++++++++++++++++++++++++++++++-
1117 bin/filter-bash-environment.py | 57 ++++++++++----
1118 bin/save-ebuild-env.sh | 2 +-
1119 man/make.conf.5 | 6 ++
1120 pym/_emerge/AbstractEbuildProcess.py | 1 +
1121 pym/portage/const.py | 1 +
1122 - 6 files changed, 192 insertions(+), 18 deletions(-)
1123 + 6 files changed, 195 insertions(+), 18 deletions(-)
1124
1125 diff --git a/bin/ebuild.sh b/bin/ebuild.sh
1126 -index f1586b2..d42ffd4 100755
1127 +index a60a24d..b592372 100755
1128 --- a/bin/ebuild.sh
1129 +++ b/bin/ebuild.sh
1130 -@@ -130,7 +130,7 @@ __qa_source() {
1131 +@@ -121,7 +121,7 @@ __qa_source() {
1132 __qa_call() {
1133 local shopts=$(shopt) OLDIFS="$IFS"
1134 local retval
1135 @@ -25,7 +25,7 @@ index f1586b2..d42ffd4 100755
1136 retval=$?
1137 set +e
1138 [[ $shopts != $(shopt) ]] &&
1139 -@@ -537,6 +537,147 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
1140 +@@ -533,6 +533,150 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
1141 unset BIN_PATH BIN BODY FUNC_SRC
1142 fi
1143
1144 @@ -146,6 +146,7 @@ index f1586b2..d42ffd4 100755
1145 +
1146 + # pre-fill the history with "$@"
1147 + echo '"$@"' >> ~/.bash_history
1148 ++ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} ~/.bash_history &>/dev/null
1149 +
1150 + env -i ${BASH} --rcfile "${__ebuildshell_tmpf}.ebuild-env" -i
1151 +
1152 @@ -161,10 +162,12 @@ index f1586b2..d42ffd4 100755
1153 + unalias -a
1154 + eval "${__ebuildshell_orig_aliases}"
1155 +
1156 -+ # Portage does whitelist readonly variables. If an ebuild defines
1157 -+ # more readonly variables, their readonly attribute is removed.
1158 -+ # If we ever want to preserve additional readonly variables across
1159 -+ # phases, their names are in "${__ebuildshell_tmpf}.return-rovars".
1160 ++ # Portage has a whitelist of readonly variables: If an ebuild defines
1161 ++ # additional readonly variables, their readonly attribute is removed
1162 ++ # across ebuild phases. If we ever want to preserve the readonly
1163 ++ # attribute of additional ebuild-defined variables across phases,
1164 ++ # when returning from the ebuildshell their names are in
1165 ++ # "${__ebuildshell_tmpf}.return-rovars"
1166 + rm -f "${__ebuildshell_tmpf}."{ebuild,return}-{env,rovars}
1167 +
1168 + return ${__ebuildshell_status}
1169 @@ -174,7 +177,7 @@ index f1586b2..d42ffd4 100755
1170 export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
1171 trap 'exit 1' SIGTERM
1172 diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
1173 -index a4cdc54..1c4ad58 100755
1174 +index 029e491..0ddda7c 100755
1175 --- a/bin/filter-bash-environment.py
1176 +++ b/bin/filter-bash-environment.py
1177 @@ -14,7 +14,8 @@ func_end_re = re.compile(r'^\}$')
1178 @@ -294,7 +297,7 @@ index a4cdc54..1c4ad58 100755
1179 + re.compile(var_pattern), file_in, file_out, options)
1180 file_out.flush()
1181 diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
1182 -index ddef1fd..7264ced 100644
1183 +index 4c6ca3f..bbb5780 100755
1184 --- a/bin/save-ebuild-env.sh
1185 +++ b/bin/save-ebuild-env.sh
1186 @@ -53,7 +53,7 @@ __save_ebuild_env() {
1187 @@ -307,10 +310,10 @@ index ddef1fd..7264ced 100644
1188 use usev useq has_version portageq \
1189 best_version use_with use_enable register_die_hook \
1190 diff --git a/man/make.conf.5 b/man/make.conf.5
1191 -index 26bbf06..865ede9 100644
1192 +index 653e8bc..2bb8e71 100644
1193 --- a/man/make.conf.5
1194 +++ b/man/make.conf.5
1195 -@@ -382,6 +382,12 @@ exist). Also see the related \fIunmerge\-backup\fR feature.
1196 +@@ -408,6 +408,12 @@ exist). Also see the related \fIunmerge\-backup\fR feature.
1197 Use locks to ensure that unsandboxed ebuild phases never execute
1198 concurrently. Also see \fIparallel\-install\fR.
1199 .TP
1200 @@ -336,10 +339,10 @@ index 8bd30a6..4ff78b4 100644
1201 "interactive" not in self.settings.get("PROPERTIES", "").split():
1202 null_fd = os.open('/dev/null', os.O_RDONLY)
1203 diff --git a/pym/portage/const.py b/pym/portage/const.py
1204 -index 814d7f4..d84f9bf 100644
1205 +index 172c5b1..a0ad1f9 100644
1206 --- a/pym/portage/const.py
1207 +++ b/pym/portage/const.py
1208 -@@ -142,6 +142,7 @@ SUPPORTED_FEATURES = frozenset([
1209 +@@ -160,6 +160,7 @@ SUPPORTED_FEATURES = frozenset([
1210 "distlocks",
1211 "downgrade-backup",
1212 "ebuild-locks",
1213 @@ -348,5 +351,5 @@ index 814d7f4..d84f9bf 100644
1214 "fakeroot",
1215 "fixlafiles",
1216 --
1217 -2.7.3
1218 +2.10.2
1219
1220
1221 diff --git a/sys-apps/portage/portage-2.3.10.ebuild b/sys-apps/portage/portage-2.3.10.ebuild
1222 index 07490db2e3..9471ca7f8d 100644
1223 --- a/sys-apps/portage/portage-2.3.10.ebuild
1224 +++ b/sys-apps/portage/portage-2.3.10.ebuild
1225 @@ -89,7 +89,7 @@ pkg_setup() {
1226 python_prepare_all() {
1227 distutils-r1_python_prepare_all
1228
1229 - epatch "${FILESDIR}"/${PN}-2.2.28-ebuildshell-r1.patch # 155161
1230 + epatch "${FILESDIR}"/${PN}-2.3.10-ebuildshell.patch # 155161
1231 use prefix-chaining &&
1232 epatch "${FILESDIR}"/${PN}-2.3.8-prefix-chaining.patch