commit:     a5e02c92fd72aad6eb9031cdc04f634543ebdd15
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 21 09:54:18 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 11 11:43:41 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a5e02c92

Support ENV_UNSET for EAPI 7

Bug: https://bugs.gentoo.org/499288

 bin/eapi.sh            | 4 ++++
 bin/ebuild.sh          | 6 ++++++
 pym/_emerge/actions.py | 4 ++--
 pym/portage/const.py   | 3 ++-
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 1d5ea802d..569b8a0de 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -215,3 +215,7 @@ ___eapi_bash_3_2() {
 ___eapi_bash_4_2() {
        ! ___eapi_bash_3_2 "$@"
 }
+
+___eapi_has_ENV_UNSET() {
+       [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ 
]]
+}

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index d63b0a0ba..67d255f78 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -137,6 +137,12 @@ shift $#
 
 # Unset some variables that break things.
 unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
+if ___eapi_has_ENV_UNSET; then
+       for x in ${ENV_UNSET}; do
+               unset "${x}"
+       done
+       unset x
+fi
 
 [[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET
 

diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 97df9f716..2293560c1 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import division, print_function, unicode_literals
@@ -1817,7 +1817,7 @@ def action_info(settings, trees, myopts, myfiles):
                myvars = list(settings)
        else:
                myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 
'CONFIG_PROTECT_MASK',
-                         'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
+                         'DISTDIR', 'ENV_UNSET', 'PKGDIR', 'PORTAGE_TMPDIR',
                          'PORTAGE_BUNZIP2_COMMAND',
                          'PORTAGE_BZIP2_COMMAND',
                          'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS',

diff --git a/pym/portage/const.py b/pym/portage/const.py
index 655be82b1..16922a5e6 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -1,5 +1,5 @@
 # portage: Constants
-# Copyright 1998-2014 Gentoo Foundation
+# Copyright 1998-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -89,6 +89,7 @@ INCREMENTALS             = (
        "ACCEPT_KEYWORDS",
        "CONFIG_PROTECT",
        "CONFIG_PROTECT_MASK",
+       "ENV_UNSET",
        "FEATURES",
        "IUSE_IMPLICIT",
        "PRELINK_PATH",

Reply via email to