commit:     d9f6cf75e9fc38cb9f4cd7158e9ae19d39585332
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 26 14:05:54 2017 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Tue Sep 26 14:05:54 2017 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=d9f6cf75

sys-apps/portage: bump ebuildshell patch

The change actually is for FEATURES=userpriv in main Gentoo Linux.

Package-Manager: Portage-2.3.10-prefix, Repoman-2.3.3

 .../files/portage-2.2.01.18213-ebuildshell.patch   | 105 --------------
 .../files/portage-2.2.01.18980-ebuildshell.patch   | 103 --------------
 .../files/portage-2.2.01.19247-ebuildshell.patch   | 105 --------------
 .../files/portage-2.2.01.19981-ebuildshell.patch   | 105 --------------
 .../files/portage-2.2.01.20020-ebuildshell.patch   | 137 ------------------
 .../files/portage-2.2.01.20239-ebuildshell.patch   | 148 -------------------
 .../portage/files/portage-2.2.7-ebuildshell.patch  | 158 ---------------------
 .../portage/files/portage-2.2.8-ebuildshell.patch  | 157 --------------------
 ...hell.patch => portage-2.3.10-ebuildshell.patch} |  37 ++---
 sys-apps/portage/portage-2.3.10.ebuild             |   2 +-
 10 files changed, 21 insertions(+), 1036 deletions(-)

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
deleted file mode 100644
index 59e98af020..0000000000
--- a/sys-apps/portage/files/portage-2.2.01.18213-ebuildshell.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-http://bugs.gentoo.org/show_bug.cgi?id=155161
-
---- portage/bin/ebuild.sh.orig 2010-12-15 11:12:12.466527126 +0100
-+++ portage/bin/ebuild.sh      2010-12-15 11:11:04.757062756 +0100
-@@ -59,7 +59,7 @@
- qa_call() {
-       local shopts=$(shopt) OLDIFS="$IFS"
-       local retval
--      "$@"
-+      call-ebuildshell "$@"
-       retval=$?
-       set +e
-       [[ $shopts != $(shopt) ]] &&
-@@ -1765,7 +1765,7 @@
- filter_readonly_variables() {
-       local x filtered_vars
-       local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
--              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-+              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
-       local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
-               HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
-               OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-@@ -1774,8 +1774,10 @@
-               SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
-               SANDBOX_LOG SANDBOX_ON"
-       local misc_garbage_vars="_portage_filter_opts"
--      filtered_vars="$readonly_bash_vars $bash_misc_vars
--              $PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      filtered_vars="$readonly_bash_vars"
-+      if ! hasq --filter-for-subshell $* ; then
-+              filtered_vars="$filtered_vars $bash_misc_vars 
$PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      fi
- 
-       # Don't filter/interfere with prefix variables unless they are
-       # supported by the current EAPI.
-@@ -1805,7 +1807,11 @@
-                       LC_CTYPE LC_MESSAGES LC_MONETARY
-                       LC_NUMERIC LC_PAPER LC_TIME"
-       fi
--      if ! hasq --allow-extra-vars $* ; then
-+      if hasq --filter-metadata $* ; then
-+              filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
-+      fi
-+      if ! hasq --allow-extra-vars $* &&
-+         ! hasq --filter-for-subshell $* ; then
-               filtered_vars="
-                       ${filtered_vars}
-                       ${PORTAGE_SAVED_READONLY_VARS}
-@@ -1936,6 +1942,56 @@
-       unset BIN_PATH BIN BODY FUNC_SRC
- fi
- 
-+call-ebuildshell() {
-+      if ! hasq ebuildshell ${FEATURES}; then
-+              "$@"
-+              return $?
-+      fi
-+      (
-+              umask 002
-+              (
-+                      (
-+                              set
-+                              declare -p
-+                              declare -fp
-+                              shopt -p
-+                              if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                                      export
-+                              fi
-+                      ) | filter_readonly_variables --filter-for-subshell
-+                      echo 'declare -r $PORTAGE_READONLY_METADATA 
$PORTAGE_READONLY_VARS'
-+                      echo "export PS1='EBUILD ${PN} $1 \$ '" 
-+                      echo 'unset ENV'
-+                      echo "type $1"
-+                      echo "echo WANTED: $@"
-+                      echo "trap '"
-+                      echo "umask 002"
-+                      echo "("
-+                      echo "  set"
-+                      echo "  declare -p"
-+                      echo "  declare -fp"
-+                      echo "  shopt -p"
-+                      if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                              echo "  export"
-+                      fi
-+                      echo -n ")"
-+                      echo -n " | filter_readonly_variables --filter-metadata"
-+                      echo " > ${T}/ebuildshell-environment-outcome' 0"
-+              ) > ${T}/ebuildshell-environment
-+              chown portage:portage "${T}/ebuildshell-environment" &>/dev/null
-+              chmod g+w "${T}/ebuildshell-environment" &>/dev/null
-+      )
-+
-+      rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
-+
-+      unset BASH_ENV
-+      env -i ${BASH} --rcfile "${T}/ebuildshell-environment"  -i || die
-+
-+      chown portage:portage "${T}/ebuildshell-environment-outcome" &>/dev/null
-+      chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
-+      source "${T}/ebuildshell-environment-outcome" &>/dev/null
-+}
-+
- # Subshell/helper die support (must export for the die helper).
- export EBUILD_MASTER_PID=$BASHPID
- trap 'exit 1' SIGTERM

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
deleted file mode 100644
index b8911f26a0..0000000000
--- a/sys-apps/portage/files/portage-2.2.01.18980-ebuildshell.patch
+++ /dev/null
@@ -1,103 +0,0 @@
---- prefix-portage-2.2.01.18980/bin/ebuild.sh
-+++ prefix-portage-2.2.01.18980/bin/ebuild.sh
-@@ -59,7 +59,7 @@
- qa_call() {
-       local shopts=$(shopt) OLDIFS="$IFS"
-       local retval
--      "$@"
-+      call-ebuildshell "$@"
-       retval=$?
-       set +e
-       [[ $shopts != $(shopt) ]] &&
-@@ -1824,7 +1824,7 @@
- filter_readonly_variables() {
-       local x filtered_vars
-       local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
--              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-+              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
-       local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
-               HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
-               OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-@@ -1833,8 +1833,10 @@
-               SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
-               SANDBOX_LOG SANDBOX_ON"
-       local misc_garbage_vars="_portage_filter_opts"
--      filtered_vars="$readonly_bash_vars $bash_misc_vars
--              $PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      filtered_vars="$readonly_bash_vars"
-+      if ! has --filter-for-subshell $* ; then
-+              filtered_vars="$filtered_vars $bash_misc_vars 
$PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      fi
- 
-       # Don't filter/interfere with prefix variables unless they are
-       # supported by the current EAPI.
-@@ -1864,7 +1866,11 @@
-                       LC_CTYPE LC_MESSAGES LC_MONETARY
-                       LC_NUMERIC LC_PAPER LC_TIME"
-       fi
--      if ! has --allow-extra-vars $* ; then
-+      if has --filter-metadata $* ; then
-+              filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
-+      fi
-+      if ! has --allow-extra-vars $* &&
-+         ! has --filter-for-subshell $* ; then
-               filtered_vars="
-                       ${filtered_vars}
-                       ${PORTAGE_SAVED_READONLY_VARS}
-@@ -1995,6 +2001,56 @@
-       unset BIN_PATH BIN BODY FUNC_SRC
- fi
- 
-+call-ebuildshell() {
-+      if ! has ebuildshell ${FEATURES}; then
-+              "$@"
-+              return $?
-+      fi
-+      (
-+              umask 002
-+              (
-+                      (
-+                              set
-+                              declare -p
-+                              declare -fp
-+                              shopt -p
-+                              if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                                      export
-+                              fi
-+                      ) | filter_readonly_variables --filter-for-subshell
-+                      echo 'declare -r $PORTAGE_READONLY_METADATA 
$PORTAGE_READONLY_VARS'
-+                      echo "export PS1='EBUILD ${PN} $1 \$ '" 
-+                      echo 'unset ENV'
-+                      echo "type $1"
-+                      echo "echo WANTED: $@"
-+                      echo "trap '"
-+                      echo "umask 002"
-+                      echo "("
-+                      echo "  set"
-+                      echo "  declare -p"
-+                      echo "  declare -fp"
-+                      echo "  shopt -p"
-+                      if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                              echo "  export"
-+                      fi
-+                      echo -n ")"
-+                      echo -n " | filter_readonly_variables --filter-metadata"
-+                      echo " > ${T}/ebuildshell-environment-outcome' 0"
-+              ) > ${T}/ebuildshell-environment
-+              chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment" &>/dev/null
-+              chmod g+w "${T}/ebuildshell-environment" &>/dev/null
-+      )
-+
-+      rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
-+
-+      unset BASH_ENV
-+      env -i ${BASH} --rcfile "${T}/ebuildshell-environment"  -i || die
-+
-+      chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment-outcome" &>/dev/null
-+      chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
-+      source "${T}/ebuildshell-environment-outcome" &>/dev/null
-+}
-+
- # Subshell/helper die support (must export for the die helper).
- export EBUILD_MASTER_PID=$BASHPID
- trap 'exit 1' SIGTERM

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
deleted file mode 100644
index 8392b12c82..0000000000
--- a/sys-apps/portage/files/portage-2.2.01.19247-ebuildshell.patch
+++ /dev/null
@@ -1,105 +0,0 @@
---- bin/ebuild.sh.orig 2011-09-16 15:43:36 +0200
-+++ bin/ebuild.sh      2011-09-16 15:51:06 +0200
-@@ -95,7 +95,7 @@
- qa_call() {
-       local shopts=$(shopt) OLDIFS="$IFS"
-       local retval
--      "$@"
-+      call-ebuildshell "$@"
-       retval=$?
-       set +e
-       [[ $shopts != $(shopt) ]] &&
-@@ -466,6 +466,56 @@
-       unset BIN_PATH BIN BODY FUNC_SRC
- fi
- 
-+call-ebuildshell() {
-+      if ! has ebuildshell ${FEATURES}; then
-+              "$@"
-+              return $?
-+      fi
-+      (
-+              umask 002
-+              (
-+                      (
-+                              set
-+                              declare -p
-+                              declare -fp
-+                              shopt -p
-+                              if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                                      export
-+                              fi
-+                      ) | filter_readonly_variables --filter-for-subshell
-+                      echo 'declare -r $PORTAGE_READONLY_METADATA 
$PORTAGE_READONLY_VARS'
-+                      echo "export PS1='EBUILD ${PN} $1 \$ '" 
-+                      echo 'unset ENV'
-+                      echo "type $1"
-+                      echo "echo WANTED: $@"
-+                      echo "trap '"
-+                      echo "umask 002"
-+                      echo "("
-+                      echo "  set"
-+                      echo "  declare -p"
-+                      echo "  declare -fp"
-+                      echo "  shopt -p"
-+                      if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                              echo "  export"
-+                      fi
-+                      echo -n ")"
-+                      echo -n " | filter_readonly_variables --filter-metadata"
-+                      echo " > ${T}/ebuildshell-environment-outcome' 0"
-+              ) > ${T}/ebuildshell-environment
-+              chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment" &>/dev/null
-+              chmod g+w "${T}/ebuildshell-environment" &>/dev/null
-+      )
-+
-+      rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
-+
-+      unset BASH_ENV
-+      env -i ${BASH} --rcfile "${T}/ebuildshell-environment"  -i || die
-+
-+      chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment-outcome" &>/dev/null
-+      chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
-+      source "${T}/ebuildshell-environment-outcome" &>/dev/null
-+}
-+
- # Subshell/helper die support (must export for the die helper).
- export EBUILD_MASTER_PID=$BASHPID
- trap 'exit 1' SIGTERM
---- bin/phase-functions.sh.orig        2011-09-16 15:45:37 +0200
-+++ bin/phase-functions.sh     2011-09-16 15:50:10 +0200
-@@ -81,7 +81,7 @@
- filter_readonly_variables() {
-       local x filtered_vars
-       local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
--              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-+              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
-       local bash_misc_vars="BASH BASH_.* COMP_WORDBREAKS HISTCMD
-               HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
-               OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-@@ -90,8 +90,10 @@
-               SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
-               SANDBOX_LOG SANDBOX_ON"
-       local misc_garbage_vars="_portage_filter_opts"
--      filtered_vars="$readonly_bash_vars $bash_misc_vars
--              $PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      filtered_vars="$readonly_bash_vars"
-+      if ! has --filter-for-subshell $* ; then
-+              filtered_vars="$filtered_vars $bash_misc_vars 
$PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      fi
- 
-       # Don't filter/interfere with prefix variables unless they are
-       # supported by the current EAPI.
-@@ -121,7 +123,11 @@
-                       LC_CTYPE LC_MESSAGES LC_MONETARY
-                       LC_NUMERIC LC_PAPER LC_TIME"
-       fi
--      if ! has --allow-extra-vars $* ; then
-+      if has --filter-metadata $* ; then
-+              filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
-+      fi
-+      if ! has --allow-extra-vars $* &&
-+         ! has --filter-for-subshell $* ; then
-               filtered_vars="
-                       ${filtered_vars}
-                       ${PORTAGE_SAVED_READONLY_VARS}

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
deleted file mode 100644
index 63c9d54372..0000000000
--- a/sys-apps/portage/files/portage-2.2.01.19981-ebuildshell.patch
+++ /dev/null
@@ -1,105 +0,0 @@
---- bin/ebuild.sh.orig 2011-09-16 15:43:36 +0200
-+++ bin/ebuild.sh      2011-09-16 15:51:06 +0200
-@@ -95,7 +95,7 @@
- qa_call() {
-       local shopts=$(shopt) OLDIFS="$IFS"
-       local retval
--      "$@"
-+      call-ebuildshell "$@"
-       retval=$?
-       set +e
-       [[ $shopts != $(shopt) ]] &&
-@@ -466,6 +466,56 @@
-       unset BIN_PATH BIN BODY FUNC_SRC
- fi
- 
-+call-ebuildshell() {
-+      if ! has ebuildshell ${FEATURES}; then
-+              "$@"
-+              return $?
-+      fi
-+      (
-+              umask 002
-+              (
-+                      (
-+                              set
-+                              declare -p
-+                              declare -fp
-+                              shopt -p
-+                              if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                                      export
-+                              fi
-+                      ) | filter_readonly_variables --filter-for-subshell
-+                      echo 'declare -r $PORTAGE_READONLY_METADATA 
$PORTAGE_READONLY_VARS'
-+                      echo "export PS1='EBUILD ${PN} $1 \$ '" 
-+                      echo 'unset ENV'
-+                      echo "type $1"
-+                      echo "echo WANTED: $@"
-+                      echo "trap '"
-+                      echo "umask 002"
-+                      echo "("
-+                      echo "  set"
-+                      echo "  declare -p"
-+                      echo "  declare -fp"
-+                      echo "  shopt -p"
-+                      if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                              echo "  export"
-+                      fi
-+                      echo -n ")"
-+                      echo -n " | filter_readonly_variables --filter-metadata"
-+                      echo " > ${T}/ebuildshell-environment-outcome' 0"
-+              ) > ${T}/ebuildshell-environment
-+              chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment" &>/dev/null
-+              chmod g+w "${T}/ebuildshell-environment" &>/dev/null
-+      )
-+
-+      rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
-+
-+      unset BASH_ENV
-+      env -i ${BASH} --rcfile "${T}/ebuildshell-environment"  -i || die
-+
-+      chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment-outcome" &>/dev/null
-+      chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
-+      source "${T}/ebuildshell-environment-outcome" &>/dev/null
-+}
-+
- # Subshell/helper die support (must export for the die helper).
- export EBUILD_MASTER_PID=$BASHPID
- trap 'exit 1' SIGTERM
---- bin/phase-functions.sh.orig        2011-09-16 15:45:37 +0200
-+++ bin/phase-functions.sh     2011-09-16 15:50:10 +0200
-@@ -81,7 +81,7 @@
- filter_readonly_variables() {
-       local x filtered_vars
-       local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
--              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-+              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
-       local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
-               HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
-               OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-@@ -90,8 +90,10 @@
-               SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
-               SANDBOX_LOG SANDBOX_ON"
-       local misc_garbage_vars="_portage_filter_opts"
--      filtered_vars="$readonly_bash_vars $bash_misc_vars
--              $PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      filtered_vars="$readonly_bash_vars"
-+      if ! has --filter-for-subshell $* ; then
-+              filtered_vars="$filtered_vars $bash_misc_vars 
$PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      fi
- 
-       # Don't filter/interfere with prefix variables unless they are
-       # supported by the current EAPI.
-@@ -121,7 +123,11 @@
-                       LC_CTYPE LC_MESSAGES LC_MONETARY
-                       LC_NUMERIC LC_PAPER LC_TIME"
-       fi
--      if ! has --allow-extra-vars $* ; then
-+      if has --filter-metadata $* ; then
-+              filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
-+      fi
-+      if ! has --allow-extra-vars $* &&
-+         ! has --filter-for-subshell $* ; then
-               filtered_vars="
-                       ${filtered_vars}
-                       ${PORTAGE_SAVED_READONLY_VARS}

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
deleted file mode 100644
index 03eaa24893..0000000000
--- a/sys-apps/portage/files/portage-2.2.01.20020-ebuildshell.patch
+++ /dev/null
@@ -1,137 +0,0 @@
-# HG changeset patch
-# User Fabian Groffen <[email protected]>
-# Date 1324637719 -3600
-# Node ID d70f677c2c1293d45e51a7f0e3b97b5e2b2900e7
-# Parent  e7a44acf78b8678781b5d24a90d96d1a53601b41
-https://bugs.gentoo.org/155161
-
-FEATURES=ebuildshell emerge xxxxx
-
-results in an interactive shell for each function portage calls from the
-ebuild, where all functionality is available as in the ebuild
-(src_unpack, epatch, etc.).  This allows for convenient debugging of
-ebuild issues.
-
-diff -r e7a44acf78b8 -r d70f677c2c12 bin/ebuild.sh
---- a/bin/ebuild.sh    Fri Dec 23 11:24:27 2011 +0100
-+++ b/bin/ebuild.sh    Fri Dec 23 11:55:19 2011 +0100
-@@ -82,7 +82,7 @@
- qa_call() {
-       local shopts=$(shopt) OLDIFS="$IFS"
-       local retval
--      "$@"
-+      call-ebuildshell "$@"
-       retval=$?
-       set +e
-       [[ $shopts != $(shopt) ]] &&
-@@ -453,6 +453,56 @@
-       unset BIN_PATH BIN BODY FUNC_SRC
- fi
- 
-+call-ebuildshell() {
-+      if ! has ebuildshell ${FEATURES}; then
-+              "$@"
-+              return $?
-+      fi
-+      (
-+              umask 002
-+              (
-+                      (
-+                              set
-+                              declare -p
-+                              declare -fp
-+                              shopt -p
-+                              if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                                      export
-+                              fi
-+                      ) | filter_readonly_variables --filter-for-subshell
-+                      echo 'declare -r $PORTAGE_READONLY_METADATA 
$PORTAGE_READONLY_VARS'
-+                      echo "export PS1='EBUILD ${PN} $1 \$ '" 
-+                      echo 'unset ENV'
-+                      echo "type $1"
-+                      echo "echo WANTED: $@"
-+                      echo "trap '"
-+                      echo "umask 002"
-+                      echo "("
-+                      echo "  set"
-+                      echo "  declare -p"
-+                      echo "  declare -fp"
-+                      echo "  shopt -p"
-+                      if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                              echo "  export"
-+                      fi
-+                      echo -n ")"
-+                      echo -n " | filter_readonly_variables --filter-metadata"
-+                      echo " > ${T}/ebuildshell-environment-outcome' 0"
-+              ) > ${T}/ebuildshell-environment
-+              chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment" &>/dev/null
-+              chmod g+w "${T}/ebuildshell-environment" &>/dev/null
-+      )
-+
-+      rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
-+
-+      unset BASH_ENV
-+      env -i ${BASH} --rcfile "${T}/ebuildshell-environment"  -i || die
-+
-+      chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment-outcome" &>/dev/null
-+      chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
-+      source "${T}/ebuildshell-environment-outcome" &>/dev/null
-+}
-+
- # Subshell/helper die support (must export for the die helper).
- export EBUILD_MASTER_PID=$BASHPID
- trap 'exit 1' SIGTERM
-diff -r e7a44acf78b8 -r d70f677c2c12 bin/phase-functions.sh
---- a/bin/phase-functions.sh   Fri Dec 23 11:24:27 2011 +0100
-+++ b/bin/phase-functions.sh   Fri Dec 23 11:55:19 2011 +0100
-@@ -84,7 +84,7 @@
- filter_readonly_variables() {
-       local x filtered_vars
-       local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
--              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-+              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
-       local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
-               HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
-               OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-@@ -95,8 +95,10 @@
-       # Untrusted due to possible application of package renames to binpkgs
-       local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
-       local misc_garbage_vars="_portage_filter_opts"
--      filtered_vars="$readonly_bash_vars $bash_misc_vars
--              $PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      filtered_vars="$readonly_bash_vars"
-+      if ! has --filter-for-subshell $* ; then
-+              filtered_vars="$filtered_vars $bash_misc_vars 
$PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      fi
- 
-       # Don't filter/interfere with prefix variables unless they are
-       # supported by the current EAPI.
-@@ -126,7 +128,11 @@
-                       LC_CTYPE LC_MESSAGES LC_MONETARY
-                       LC_NUMERIC LC_PAPER LC_TIME"
-       fi
--      if ! has --allow-extra-vars $* ; then
-+      if has --filter-metadata $* ; then
-+              filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
-+      fi
-+      if ! has --allow-extra-vars $* &&
-+         ! has --filter-for-subshell $* ; then
-               if [ "${EMERGE_FROM}" = binary ] ; then
-                       # preserve additional variables from build time,
-                       # while excluding untrusted variables
-diff -r e7a44acf78b8 -r d70f677c2c12 man/make.conf.5
---- a/man/make.conf.5  Fri Dec 23 11:24:27 2011 +0100
-+++ b/man/make.conf.5  Fri Dec 23 11:55:19 2011 +0100
-@@ -287,6 +287,12 @@
- Use locks to ensure that unsandboxed ebuild phases never execute
- concurrently. Also see \fIparallel\-install\fR.
- .TP
-+.B ebuildshell
-+Drop into an interactive shell for each phase function, meant for
-+debugging.  Because the shell would normally be used to execute the
-+phase function, commands like src_unpack or epatch are available in the
-+interactive shell.  Use `exit 1` to terminate the merge.
-+.TP
- .B fakeroot
- Enable fakeroot for the install and package phases when a non-root user runs
- the \fBebuild\fR(1) command.

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
deleted file mode 100644
index 9ccc1e5b18..0000000000
--- a/sys-apps/portage/files/portage-2.2.01.20239-ebuildshell.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-# HG changeset patch
-# User Michael Haubenwallner <[email protected]>
-# Date 1330634734 -3600
-# Node ID 6780ee2ddb337bbd8b4b2681615de7e78e6fb8c1
-# Parent  04da3d4d44af4fd2096316f8e1bbb7a998011040
-https://bugs.gentoo.org/155161
-
-FEATURES=ebuildshell emerge xxxxx
-
-results in an interactive shell for each function portage calls from the
-ebuild, where all functionality is available as in the ebuild
-(src_unpack, epatch, etc.).  This allows for convenient debugging of
-ebuild issues.
-
-diff -r 04da3d4d44af -r 6780ee2ddb33 bin/ebuild.sh
---- a/bin/ebuild.sh    Thu Mar 01 21:31:12 2012 +0100
-+++ b/bin/ebuild.sh    Thu Mar 01 21:45:34 2012 +0100
-@@ -82,7 +82,7 @@
- qa_call() {
-       local shopts=$(shopt) OLDIFS="$IFS"
-       local retval
--      "$@"
-+      call-ebuildshell "$@"
-       retval=$?
-       set +e
-       [[ $shopts != $(shopt) ]] &&
-@@ -453,6 +453,56 @@
-       unset BIN_PATH BIN BODY FUNC_SRC
- fi
- 
-+call-ebuildshell() {
-+      if ! has ebuildshell ${FEATURES}; then
-+              "$@"
-+              return $?
-+      fi
-+      (
-+              umask 002
-+              (
-+                      (
-+                              set
-+                              declare -p
-+                              declare -fp
-+                              shopt -p
-+                              if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                                      export
-+                              fi
-+                      ) | filter_readonly_variables --filter-for-subshell
-+                      echo 'declare -r $PORTAGE_READONLY_METADATA 
$PORTAGE_READONLY_VARS'
-+                      echo "export PS1='EBUILD ${PN} $1 \$ '" 
-+                      echo 'unset ENV'
-+                      echo "type $1"
-+                      echo "echo WANTED: $@"
-+                      echo "trap '"
-+                      echo "umask 002"
-+                      echo "("
-+                      echo "  set"
-+                      echo "  declare -p"
-+                      echo "  declare -fp"
-+                      echo "  shopt -p"
-+                      if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                              echo "  export"
-+                      fi
-+                      echo -n ")"
-+                      echo -n " | filter_readonly_variables --filter-metadata"
-+                      echo " > ${T}/ebuildshell-environment-outcome' 0"
-+              ) > ${T}/ebuildshell-environment
-+              chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment" &>/dev/null
-+              chmod g+w "${T}/ebuildshell-environment" &>/dev/null
-+      )
-+
-+      rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
-+
-+      unset BASH_ENV
-+      env -i ${BASH} --rcfile "${T}/ebuildshell-environment"  -i || die
-+
-+      chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment-outcome" &>/dev/null
-+      chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
-+      source "${T}/ebuildshell-environment-outcome" &>/dev/null
-+}
-+
- # Subshell/helper die support (must export for the die helper).
- export EBUILD_MASTER_PID=$BASHPID
- trap 'exit 1' SIGTERM
-diff -r 04da3d4d44af -r 6780ee2ddb33 bin/phase-functions.sh
---- a/bin/phase-functions.sh   Thu Mar 01 21:31:12 2012 +0100
-+++ b/bin/phase-functions.sh   Thu Mar 01 21:45:34 2012 +0100
-@@ -84,7 +84,7 @@
- filter_readonly_variables() {
-       local x filtered_vars
-       local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
--              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-+              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
-       local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
-               HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
-               OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-@@ -95,8 +95,10 @@
-       # Untrusted due to possible application of package renames to binpkgs
-       local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
-       local misc_garbage_vars="_portage_filter_opts"
--      filtered_vars="$readonly_bash_vars $bash_misc_vars
--              $PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      filtered_vars="$readonly_bash_vars"
-+      if ! has --filter-for-subshell $* ; then
-+              filtered_vars="$filtered_vars $bash_misc_vars 
$PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      fi
- 
-       # Don't filter/interfere with prefix variables unless they are
-       # supported by the current EAPI.
-@@ -126,7 +128,11 @@
-                       LC_CTYPE LC_MESSAGES LC_MONETARY
-                       LC_NUMERIC LC_PAPER LC_TIME"
-       fi
--      if ! has --allow-extra-vars $* ; then
-+      if has --filter-metadata $* ; then
-+              filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
-+      fi
-+      if ! has --allow-extra-vars $* &&
-+         ! has --filter-for-subshell $* ; then
-               if [ "${EMERGE_FROM}" = binary ] ; then
-                       # preserve additional variables from build time,
-                       # while excluding untrusted variables
-diff -r 04da3d4d44af -r 6780ee2ddb33 man/make.conf.5
---- a/man/make.conf.5  Thu Mar 01 21:31:12 2012 +0100
-+++ b/man/make.conf.5  Thu Mar 01 21:45:34 2012 +0100
-@@ -297,6 +297,12 @@
- Use locks to ensure that unsandboxed ebuild phases never execute
- concurrently. Also see \fIparallel\-install\fR.
- .TP
-+.B ebuildshell
-+Drop into an interactive shell for each phase function, meant for
-+debugging.  Because the shell would normally be used to execute the
-+phase function, commands like src_unpack or epatch are available in the
-+interactive shell.  Use `exit 1` to terminate the merge.
-+.TP
- .B fakeroot
- Enable fakeroot for the install and package phases when a non-root user runs
- the \fBebuild\fR(1) command.
-diff -r 04da3d4d44af -r 6780ee2ddb33 pym/_emerge/AbstractEbuildProcess.py
---- a/pym/_emerge/AbstractEbuildProcess.py     Thu Mar 01 21:31:12 2012 +0100
-+++ b/pym/_emerge/AbstractEbuildProcess.py     Thu Mar 01 21:45:34 2012 +0100
-@@ -97,6 +97,7 @@
-                       self.fd_pipes = {}
-               null_fd = None
-               if 0 not in self.fd_pipes and \
-+                      "ebuildshell" not in self.settings.features and \
-                       self.phase not in self._phases_interactive_whitelist 
and \
-                       "interactive" not in self.settings.get("PROPERTIES", 
"").split():
-                       null_fd = os.open('/dev/null', os.O_RDONLY)

diff --git a/sys-apps/portage/files/portage-2.2.7-ebuildshell.patch 
b/sys-apps/portage/files/portage-2.2.7-ebuildshell.patch
deleted file mode 100644
index 5c8cec81f7..0000000000
--- a/sys-apps/portage/files/portage-2.2.7-ebuildshell.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-diff --git a/bin/ebuild.sh b/bin/ebuild.sh
-index 35f4b91..8e702d0 100755
---- a/bin/ebuild.sh
-+++ b/bin/ebuild.sh
-@@ -90,7 +90,7 @@ __qa_source() {
- __qa_call() {
-       local shopts=$(shopt) OLDIFS="$IFS"
-       local retval
--      "$@"
-+      __call-ebuildshell "$@"
-       retval=$?
-       set +e
-       [[ $shopts != $(shopt) ]] &&
-@@ -467,6 +467,58 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
-       unset BIN_PATH BIN BODY FUNC_SRC
- fi
- 
-+__call-ebuildshell() {
-+      if ! has ebuildshell ${FEATURES}; then
-+              "$@"
-+              return $?
-+      fi
-+      (
-+              umask 002
-+              (
-+                      (
-+                              set
-+                              declare -p
-+                              declare -fp
-+                              shopt -p
-+                              if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                                      export
-+                              fi
-+                      ) | __filter_readonly_variables --filter-for-subshell
-+                      echo 'declare -r $PORTAGE_READONLY_METADATA 
$PORTAGE_READONLY_VARS'
-+                      echo "export PS1='EBUILD ${PN} $1 \$ '" 
-+                      echo 'unset ENV'
-+                      echo "type $1"
-+                      echo "echo WANTED: $@"
-+                      echo "trap '"
-+                      echo "umask 002"
-+                      echo "("
-+                      echo "  set"
-+                      echo "  declare -p"
-+                      echo "  declare -fp"
-+                      echo "  shopt -p | grep -v extdebug$"
-+                      if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                              echo "  export"
-+                      fi
-+                      echo -n ")"
-+                      echo -n " | __filter_readonly_variables 
--filter-metadata"
-+                      echo " > ${T}/ebuildshell-environment-outcome' 0"
-+                      echo "shopt -u extdebug"
-+                      echo "trap - DEBUG"
-+              ) > ${T}/ebuildshell-environment
-+              chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment" &>/dev/null
-+              chmod g+w "${T}/ebuildshell-environment" &>/dev/null
-+      )
-+
-+      rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
-+
-+      unset BASH_ENV
-+      env -i ${BASH} --rcfile "${T}/ebuildshell-environment"  -i || die
-+
-+      chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment-outcome" &>/dev/null
-+      chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
-+      source "${T}/ebuildshell-environment-outcome" &>/dev/null
-+}
-+
- # Subshell/helper die support (must export for the die helper).
- export EBUILD_MASTER_PID=$BASHPID
- trap 'exit 1' SIGTERM
-diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
-index 711b721..5f3a8a2 100644
---- a/bin/phase-functions.sh
-+++ b/bin/phase-functions.sh
-@@ -87,7 +87,7 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
- __filter_readonly_variables() {
-       local x filtered_vars
-       local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
--              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-+              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
-       local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
-               HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
-               OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-@@ -98,12 +98,14 @@ __filter_readonly_variables() {
-       # Untrusted due to possible application of package renames to binpkgs
-       local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
-       local misc_garbage_vars="_portage_filter_opts"
--      filtered_vars="$readonly_bash_vars $bash_misc_vars
--              $PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      filtered_vars="$readonly_bash_vars"
-+      if ! has --filter-for-subshell $* ; then
-+              filtered_vars="$filtered_vars $bash_misc_vars 
$PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      fi
- 
-       # Don't filter/interfere with prefix variables unless they are
-       # supported by the current EAPI.
--      if ___eapi_has_prefix_variables; then
-+      if ___eapi_has_prefix_variables && ! has --filter-for-subshell $* ; then
-               filtered_vars+=" ED EPREFIX EROOT"
-       fi
- 
-@@ -123,7 +125,11 @@ __filter_readonly_variables() {
-                       LC_CTYPE LC_MESSAGES LC_MONETARY
-                       LC_NUMERIC LC_PAPER LC_TIME"
-       fi
--      if ! has --allow-extra-vars $* ; then
-+      if has --filter-metadata $* ; then
-+              filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
-+      fi
-+      if ! has --allow-extra-vars $* &&
-+         ! has --filter-for-subshell $* ; then
-               if [ "${EMERGE_FROM}" = binary ] ; then
-                       # preserve additional variables from build time,
-                       # while excluding untrusted variables
-diff --git a/man/make.conf.5 b/man/make.conf.5
-index ab9b44e..45903e3 100644
---- a/man/make.conf.5
-+++ b/man/make.conf.5
-@@ -345,6 +345,12 @@ exist). Also see the related \fIunmerge\-backup\fR 
feature.
- Use locks to ensure that unsandboxed ebuild phases never execute
- concurrently. Also see \fIparallel\-install\fR.
- .TP
-+.B ebuildshell
-+Drop into an interactive shell for each phase function, meant for
-+debugging.  Because the shell would normally be used to execute the
-+phase function, commands like src_unpack or epatch are available in the
-+interactive shell.  Use `exit 1` to terminate the merge.
-+.TP
- .B fakeroot
- Enable fakeroot for the install and package phases when a non-root user runs
- the \fBebuild\fR(1) command.
-diff --git a/pym/_emerge/AbstractEbuildProcess.py 
b/pym/_emerge/AbstractEbuildProcess.py
-index 31127f4..73031d0 100644
---- a/pym/_emerge/AbstractEbuildProcess.py
-+++ b/pym/_emerge/AbstractEbuildProcess.py
-@@ -136,6 +136,7 @@ class AbstractEbuildProcess(SpawnProcess):
-                       self.fd_pipes = {}
-               null_fd = None
-               if 0 not in self.fd_pipes and \
-+                      "ebuildshell" not in self.settings.features and \
-                       self.phase not in self._phases_interactive_whitelist 
and \
-                       "interactive" not in self.settings.get("PROPERTIES", 
"").split():
-                       null_fd = os.open('/dev/null', os.O_RDONLY)
-diff --git a/pym/portage/const.py b/pym/portage/const.py
-index 214ede4..725a7d0 100644
---- a/pym/portage/const.py
-+++ b/pym/portage/const.py
-@@ -100,7 +100,7 @@ SUPPORTED_FEATURES       = frozenset([
-                            "collision-protect", "compress-build-logs", 
"compressdebug",
-                            "compress-index", "config-protect-if-modified",
-                            "digest", "distcc", "distcc-pump", "distlocks",
--                           "downgrade-backup", "ebuild-locks", "fakeroot",
-+                           "downgrade-backup", "ebuildshell", "ebuild-locks", 
"fakeroot",
-                            "fail-clean", "force-mirror", "force-prefix", 
"getbinpkg",
-                            "installsources", "ipc-sandbox",
-                            "keeptemp", "keepwork", "fixlafiles", "lmirror",

diff --git a/sys-apps/portage/files/portage-2.2.8-ebuildshell.patch 
b/sys-apps/portage/files/portage-2.2.8-ebuildshell.patch
deleted file mode 100644
index 82219eb7f9..0000000000
--- a/sys-apps/portage/files/portage-2.2.8-ebuildshell.patch
+++ /dev/null
@@ -1,157 +0,0 @@
-diff --git a/bin/ebuild.sh b/bin/ebuild.sh
-index 35f4b91..8e702d0 100755
---- a/bin/ebuild.sh
-+++ b/bin/ebuild.sh
-@@ -90,7 +90,7 @@
- __qa_call() {
-       local shopts=$(shopt) OLDIFS="$IFS"
-       local retval
--      "$@"
-+      __call-ebuildshell "$@"
-       retval=$?
-       set +e
-       [[ $shopts != $(shopt) ]] &&
-@@ -467,6 +467,58 @@
-       unset BIN_PATH BIN BODY FUNC_SRC
- fi
- 
-+__call-ebuildshell() {
-+      if ! has ebuildshell ${FEATURES}; then
-+              "$@"
-+              return $?
-+      fi
-+      (
-+              umask 002
-+              (
-+                      (
-+                              set
-+                              declare -p
-+                              declare -fp
-+                              shopt -p
-+                              if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                                      export
-+                              fi
-+                      ) | __filter_readonly_variables --filter-for-subshell
-+                      echo 'declare -r $PORTAGE_READONLY_METADATA 
$PORTAGE_READONLY_VARS'
-+                      echo "export PS1='EBUILD ${PN} $1 \$ '" 
-+                      echo 'unset ENV'
-+                      echo "type $1"
-+                      echo "echo WANTED: $@"
-+                      echo "trap '"
-+                      echo "umask 002"
-+                      echo "("
-+                      echo "  set"
-+                      echo "  declare -p"
-+                      echo "  declare -fp"
-+                      echo "  shopt -p | grep -v extdebug$"
-+                      if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
-+                              echo "  export"
-+                      fi
-+                      echo -n ")"
-+                      echo -n " | __filter_readonly_variables 
--filter-metadata"
-+                      echo " > ${T}/ebuildshell-environment-outcome' 0"
-+                      echo "shopt -u extdebug"
-+                      echo "trap - DEBUG"
-+              ) > ${T}/ebuildshell-environment
-+              chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment" &>/dev/null
-+              chmod g+w "${T}/ebuildshell-environment" &>/dev/null
-+      )
-+
-+      rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
-+
-+      unset BASH_ENV
-+      env -i ${BASH} --rcfile "${T}/ebuildshell-environment"  -i || die
-+
-+      chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
"${T}/ebuildshell-environment-outcome" &>/dev/null
-+      chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
-+      source "${T}/ebuildshell-environment-outcome" &>/dev/null
-+}
-+
- # Subshell/helper die support (must export for the die helper).
- export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
- trap 'exit 1' SIGTERM
-diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
-index 711b721..5f3a8a2 100644
---- a/bin/phase-functions.sh
-+++ b/bin/phase-functions.sh
-@@ -87,7 +87,7 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
- __filter_readonly_variables() {
-       local x filtered_vars
-       local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
--              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
-+              FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
-       local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
-               HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
-               OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
-@@ -98,12 +98,14 @@ __filter_readonly_variables() {
-       # Untrusted due to possible application of package renames to binpkgs
-       local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
-       local misc_garbage_vars="_portage_filter_opts"
--      filtered_vars="$readonly_bash_vars $bash_misc_vars
--              $PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      filtered_vars="$readonly_bash_vars"
-+      if ! has --filter-for-subshell $* ; then
-+              filtered_vars="$filtered_vars $bash_misc_vars 
$PORTAGE_READONLY_VARS $misc_garbage_vars"
-+      fi
- 
-       # Don't filter/interfere with prefix variables unless they are
-       # supported by the current EAPI.
--      if ___eapi_has_prefix_variables; then
-+      if ___eapi_has_prefix_variables && ! has --filter-for-subshell $* ; then
-               filtered_vars+=" ED EPREFIX EROOT"
-       fi
- 
-@@ -123,7 +125,11 @@ __filter_readonly_variables() {
-                       LC_CTYPE LC_MESSAGES LC_MONETARY
-                       LC_NUMERIC LC_PAPER LC_TIME"
-       fi
--      if ! has --allow-extra-vars $* ; then
-+      if has --filter-metadata $* ; then
-+              filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
-+      fi
-+      if ! has --allow-extra-vars $* &&
-+         ! has --filter-for-subshell $* ; then
-               if [ "${EMERGE_FROM}" = binary ] ; then
-                       # preserve additional variables from build time,
-                       # while excluding untrusted variables
-diff --git a/man/make.conf.5 b/man/make.conf.5
-index ab9b44e..45903e3 100644
---- a/man/make.conf.5
-+++ b/man/make.conf.5
-@@ -346,6 +346,12 @@
- Use locks to ensure that unsandboxed ebuild phases never execute
- concurrently. Also see \fIparallel\-install\fR.
- .TP
-+.B ebuildshell
-+Drop into an interactive shell for each phase function, meant for
-+debugging.  Because the shell would normally be used to execute the
-+phase function, commands like src_unpack or epatch are available in the
-+interactive shell.  Use `exit 1` to terminate the merge.
-+.TP
- .B fakeroot
- Enable fakeroot for the install and package phases when a non-root user runs
- the \fBebuild\fR(1) command.
-diff --git a/pym/_emerge/AbstractEbuildProcess.py 
b/pym/_emerge/AbstractEbuildProcess.py
-index 31127f4..73031d0 100644
---- a/pym/_emerge/AbstractEbuildProcess.py
-+++ b/pym/_emerge/AbstractEbuildProcess.py
-@@ -136,6 +136,7 @@ class AbstractEbuildProcess(SpawnProcess):
-                       self.fd_pipes = {}
-               null_fd = None
-               if 0 not in self.fd_pipes and \
-+                      "ebuildshell" not in self.settings.features and \
-                       self.phase not in self._phases_interactive_whitelist 
and \
-                       "interactive" not in self.settings.get("PROPERTIES", 
"").split():
-                       null_fd = os.open('/dev/null', os.O_RDONLY)
-diff --git a/pym/portage/const.py b/pym/portage/const.py
-index 214ede4..725a7d0 100644
---- a/pym/portage/const.py
-+++ b/pym/portage/const.py
-@@ -139,6 +139,7 @@ SUPPORTED_FEATURES       = frozenset([
-       "distlocks",
-       "downgrade-backup",
-       "ebuild-locks",
-+      "ebuildshell",
-       "fail-clean",
-       "fakeroot",
-       "fixlafiles",

diff --git a/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch 
b/sys-apps/portage/files/portage-2.3.10-ebuildshell.patch
similarity index 92%
rename from sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
rename to sys-apps/portage/files/portage-2.3.10-ebuildshell.patch
index 4674506d98..d0381a0696 100644
--- a/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
+++ b/sys-apps/portage/files/portage-2.3.10-ebuildshell.patch
@@ -1,22 +1,22 @@
-From 5e3167845640624f328969355db2e7f16cad2c83 Mon Sep 17 00:00:00 2001
+From 05a16e4c910f7dc053358d8519c6708d3a4b14ca Mon Sep 17 00:00:00 2001
 From: Michael Haubenwallner <[email protected]>
 Date: Wed, 6 Nov 2013 12:40:05 +0100
 Subject: [PATCH] Add ebuildshell feature, bug#155161.
 
 ---
- bin/ebuild.sh                        | 143 ++++++++++++++++++++++++++++++++++-
+ bin/ebuild.sh                        | 146 ++++++++++++++++++++++++++++++++++-
  bin/filter-bash-environment.py       |  57 ++++++++++----
  bin/save-ebuild-env.sh               |   2 +-
  man/make.conf.5                      |   6 ++
  pym/_emerge/AbstractEbuildProcess.py |   1 +
  pym/portage/const.py                 |   1 +
- 6 files changed, 192 insertions(+), 18 deletions(-)
+ 6 files changed, 195 insertions(+), 18 deletions(-)
 
 diff --git a/bin/ebuild.sh b/bin/ebuild.sh
-index f1586b2..d42ffd4 100755
+index a60a24d..b592372 100755
 --- a/bin/ebuild.sh
 +++ b/bin/ebuild.sh
-@@ -130,7 +130,7 @@ __qa_source() {
+@@ -121,7 +121,7 @@ __qa_source() {
  __qa_call() {
        local shopts=$(shopt) OLDIFS="$IFS"
        local retval
@@ -25,7 +25,7 @@ index f1586b2..d42ffd4 100755
        retval=$?
        set +e
        [[ $shopts != $(shopt) ]] &&
-@@ -537,6 +537,147 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
+@@ -533,6 +533,150 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
        unset BIN_PATH BIN BODY FUNC_SRC
  fi
  
@@ -146,6 +146,7 @@ index f1586b2..d42ffd4 100755
 +
 +      # pre-fill the history with "$@"
 +      echo '"$@"' >> ~/.bash_history
++      chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} 
~/.bash_history &>/dev/null
 +
 +      env -i ${BASH} --rcfile "${__ebuildshell_tmpf}.ebuild-env" -i
 +
@@ -161,10 +162,12 @@ index f1586b2..d42ffd4 100755
 +      unalias -a
 +      eval "${__ebuildshell_orig_aliases}"
 +
-+      # Portage does whitelist readonly variables. If an ebuild defines
-+      # more readonly variables, their readonly attribute is removed.
-+      # If we ever want to preserve additional readonly variables across
-+      # phases, their names are in "${__ebuildshell_tmpf}.return-rovars".
++      # Portage has a whitelist of readonly variables: If an ebuild defines
++      # additional readonly variables, their readonly attribute is removed
++      # across ebuild phases.  If we ever want to preserve the readonly
++      # attribute of additional ebuild-defined variables across phases,
++      # when returning from the ebuildshell their names are in
++      # "${__ebuildshell_tmpf}.return-rovars"
 +      rm -f "${__ebuildshell_tmpf}."{ebuild,return}-{env,rovars}
 +
 +      return ${__ebuildshell_status}
@@ -174,7 +177,7 @@ index f1586b2..d42ffd4 100755
  export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
  trap 'exit 1' SIGTERM
 diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
-index a4cdc54..1c4ad58 100755
+index 029e491..0ddda7c 100755
 --- a/bin/filter-bash-environment.py
 +++ b/bin/filter-bash-environment.py
 @@ -14,7 +14,8 @@ func_end_re = re.compile(r'^\}$')
@@ -294,7 +297,7 @@ index a4cdc54..1c4ad58 100755
 +              re.compile(var_pattern), file_in, file_out, options)
        file_out.flush()
 diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
-index ddef1fd..7264ced 100644
+index 4c6ca3f..bbb5780 100755
 --- a/bin/save-ebuild-env.sh
 +++ b/bin/save-ebuild-env.sh
 @@ -53,7 +53,7 @@ __save_ebuild_env() {
@@ -307,10 +310,10 @@ index ddef1fd..7264ced 100644
                use usev useq has_version portageq \
                best_version use_with use_enable register_die_hook \
 diff --git a/man/make.conf.5 b/man/make.conf.5
-index 26bbf06..865ede9 100644
+index 653e8bc..2bb8e71 100644
 --- a/man/make.conf.5
 +++ b/man/make.conf.5
-@@ -382,6 +382,12 @@ exist). Also see the related \fIunmerge\-backup\fR 
feature.
+@@ -408,6 +408,12 @@ exist). Also see the related \fIunmerge\-backup\fR 
feature.
  Use locks to ensure that unsandboxed ebuild phases never execute
  concurrently. Also see \fIparallel\-install\fR.
  .TP
@@ -336,10 +339,10 @@ index 8bd30a6..4ff78b4 100644
                        "interactive" not in self.settings.get("PROPERTIES", 
"").split():
                        null_fd = os.open('/dev/null', os.O_RDONLY)
 diff --git a/pym/portage/const.py b/pym/portage/const.py
-index 814d7f4..d84f9bf 100644
+index 172c5b1..a0ad1f9 100644
 --- a/pym/portage/const.py
 +++ b/pym/portage/const.py
-@@ -142,6 +142,7 @@ SUPPORTED_FEATURES       = frozenset([
+@@ -160,6 +160,7 @@ SUPPORTED_FEATURES       = frozenset([
        "distlocks",
        "downgrade-backup",
        "ebuild-locks",
@@ -348,5 +351,5 @@ index 814d7f4..d84f9bf 100644
        "fakeroot",
        "fixlafiles",
 -- 
-2.7.3
+2.10.2
 

diff --git a/sys-apps/portage/portage-2.3.10.ebuild 
b/sys-apps/portage/portage-2.3.10.ebuild
index 07490db2e3..9471ca7f8d 100644
--- a/sys-apps/portage/portage-2.3.10.ebuild
+++ b/sys-apps/portage/portage-2.3.10.ebuild
@@ -89,7 +89,7 @@ pkg_setup() {
 python_prepare_all() {
        distutils-r1_python_prepare_all
 
-       epatch "${FILESDIR}"/${PN}-2.2.28-ebuildshell-r1.patch # 155161
+       epatch "${FILESDIR}"/${PN}-2.3.10-ebuildshell.patch # 155161
        use prefix-chaining &&
                epatch "${FILESDIR}"/${PN}-2.3.8-prefix-chaining.patch
 

Reply via email to