commit:     5fc496c38e3464658a258557d31849ebd9598109
Author:     Michael Haubenwallner <michael.haubenwallner <AT> ssi-schaefer 
<DOT> com>
AuthorDate: Fri May 13 11:38:53 2016 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Fri May 13 11:39:24 2016 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5fc496c3

+sys-apps/portage-2.2.28-r4: bump ebuildshell patch to bug#155161 comment#36

Package-Manager: portage-2.2.28-prefix

 .../portage/files/portage-2.2.28-ebuildshell.patch | 50 +++++++++++++++-------
 ...e-2.2.28-r3.ebuild => portage-2.2.28-r4.ebuild} |  0
 2 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch 
b/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
index 69373f6..4674506 100644
--- a/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
+++ b/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
@@ -1,19 +1,19 @@
-From 3ae829681363c032c9863d4e5a41a762af89f93e Mon Sep 17 00:00:00 2001
+From 5e3167845640624f328969355db2e7f16cad2c83 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                        | 123 ++++++++++++++++++++++++++++++++++-
- bin/filter-bash-environment.py       |  57 +++++++++++-----
+ bin/ebuild.sh                        | 143 ++++++++++++++++++++++++++++++++++-
+ 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, 172 insertions(+), 18 deletions(-)
+ 6 files changed, 192 insertions(+), 18 deletions(-)
 
 diff --git a/bin/ebuild.sh b/bin/ebuild.sh
-index f1586b2..8231a98 100755
+index f1586b2..d42ffd4 100755
 --- a/bin/ebuild.sh
 +++ b/bin/ebuild.sh
 @@ -130,7 +130,7 @@ __qa_source() {
@@ -25,7 +25,7 @@ index f1586b2..8231a98 100755
        retval=$?
        set +e
        [[ $shopts != $(shopt) ]] &&
-@@ -537,6 +537,127 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
+@@ -537,6 +537,147 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
        unset BIN_PATH BIN BODY FUNC_SRC
  fi
  
@@ -46,6 +46,19 @@ index f1586b2..8231a98 100755
 +      local __ebuildshell_tmpf="${T}/ebuildshell.${__ebuildshell_pid}"
 +      rm -f "${__ebuildshell_tmpf}."{ebuild,return}-{env,rovars}
 +      (
++              cat <<-EOE
++                      # local variables of functions using recursive 
ebuildshell are
++                      # visible to the EXIT trap of that recursive 
ebuildshell.  To
++                      # keep them local, we have to filter them from that 
recursive
++                      # ebuildshell's return-env.  As 'declare -p' is unable 
to tell
++                      # local-ity of variables, we abuse the trace attribute 
for local
++                      # variables to filter them from the return-env.  So we 
need the
++                      # local alias active before declaring any functions.
++                      # On a sidehand, this allows for copy&paste of function 
body
++                      # lines including the local keyword.
++                      alias local='declare -t'
++                      shopt -s expand_aliases
++              EOE
 +              (
 +                      declare -p
 +                      declare -fp
@@ -62,6 +75,17 @@ index f1586b2..8231a98 100755
 +                                      "${__ebuildshell_bash_i_vars}" \
 +                              || die "filter-bash-environment.py failed"
 +              )
++              # 'declare -g' is available since bash-4.2,
++              # https://bugs.gentoo.org/show_bug.cgi?id=155161#c35
++              if (( ${BASH_VERSINFO[0]} > 4 )) ||
++                 (( ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} >= 2 ))
++              then
++                      __ebuildshell_bash42_true=
++                      __ebuildshell_bash42_false='#bash-4.2#'
++              else
++                  __ebuildshell_bash42_true='#bash-4.2#'
++                  __ebuildshell_bash42_false=
++              fi
 +              # The already readonly variables, without bash maintained ones:
 +              
__ebuildshell_ro_ebuild_vars=$(<"${__ebuildshell_tmpf}.ebuild-rovars")
 +              cat <<-EOE
@@ -72,6 +96,7 @@ index f1586b2..8231a98 100755
 +                      # be informative about what to do
 +                      PS1="EBUILD ${PN} $1 \$ "
 +                      type $1
++                      ${__ebuildshell_bash42_false}echo 'warning: preserving 
variables across phases requires bash-4.2'
 +                      echo "WANTED: \$@"
 +                      echo "or use: \"\\\$@\""
 +                      # use bash history, but not the 'user's real one
@@ -79,12 +104,6 @@ index f1586b2..8231a98 100755
 +                      # but do not use history-expansion with '!',
 +                      # for copy&paste of function body lines containing: !
 +                      set +H
-+                      # For copy&paste of function body lines, we want the 
'local'
-+                      # keyword available at the shell prompt as well.  So we 
alias
-+                      # the 'local' keyword to 'declare -t', to identify local
-+                      # variables by their trace attribute.
-+                      alias local='declare -t'
-+                      shopt -s expand_aliases
 +                      # this is a debugging shell already
 +                      shopt -u extdebug
 +                      trap - DEBUG
@@ -97,16 +116,17 @@ index f1586b2..8231a98 100755
 +                                      (
 +                                              # declare -p does not tell the 
-g flag,
 +                                              # so we add it by aliasing 
declare.
-+                                              echo \"alias declare='declare 
-g'\"
++                                              
${__ebuildshell_bash42_true}echo \"alias declare='declare -g'\"
 +                                              declare -p
-+                                              echo \"unalias declare\"
++                                              
${__ebuildshell_bash42_true}echo \"unalias declare\"
 +                                              declare -fp
 +                                              shopt -p | grep -v 
'\\(expand_aliases\\|extdebug\\)$'
 +                                              $([[ ${BASH_VERSINFO[0]} == 3 
]] && echo export)
 +                                      ) |
 +                                      (
 +                                              # We may have more readonly 
variables now, yet we
-+                                              # need to filter variables that 
are readonly already.
++                                              # need to filter variables that 
were readonly before.
++                                              # And filter local variables by 
their trace attribute.
 +                                              
2>'${__ebuildshell_tmpf}.return-rovars' \\
 +                                              
'${PORTAGE_PYTHON:-/tools/haubi/gentoo/s01en24/usr/bin/python}' \\
 +                                                      
'${PORTAGE_BIN_PATH}'/filter-bash-environment.py \\

diff --git a/sys-apps/portage/portage-2.2.28-r3.ebuild 
b/sys-apps/portage/portage-2.2.28-r4.ebuild
similarity index 100%
rename from sys-apps/portage/portage-2.2.28-r3.ebuild
rename to sys-apps/portage/portage-2.2.28-r4.ebuild

Reply via email to