Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH eapi6-pt2 v2 5/6] Support ENV_UNSET for EAPI 7
Date: Fri, 09 Mar 2018 07:30:19
Message-Id: 20180309072946.20825-5-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH eapi6-pt2 v2 1/6] Allow package.*, use.* directories in EAPI 7 by "Michał Górny"
1 Bug: https://bugs.gentoo.org/499288
2 ---
3 bin/eapi.sh | 4 ++++
4 bin/ebuild.sh | 6 ++++++
5 pym/_emerge/actions.py | 4 ++--
6 pym/portage/const.py | 3 ++-
7 4 files changed, 14 insertions(+), 3 deletions(-)
8
9 diff --git a/bin/eapi.sh b/bin/eapi.sh
10 index cd2acad80..3e837f19d 100644
11 --- a/bin/eapi.sh
12 +++ b/bin/eapi.sh
13 @@ -223,3 +223,7 @@ ___eapi_bash_3_2() {
14 ___eapi_bash_4_2() {
15 ! ___eapi_bash_3_2 "$@"
16 }
17 +
18 +___eapi_has_ENV_UNSET() {
19 + [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]]
20 +}
21 diff --git a/bin/ebuild.sh b/bin/ebuild.sh
22 index 9194d21d7..41b12b508 100755
23 --- a/bin/ebuild.sh
24 +++ b/bin/ebuild.sh
25 @@ -137,6 +137,12 @@ shift $#
26
27 # Unset some variables that break things.
28 unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
29 +if ___eapi_has_ENV_UNSET; then
30 + for x in ${ENV_UNSET}; do
31 + unset "${x}"
32 + done
33 + unset x
34 +fi
35
36 [[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET
37
38 diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
39 index 97df9f716..2293560c1 100644
40 --- a/pym/_emerge/actions.py
41 +++ b/pym/_emerge/actions.py
42 @@ -1,4 +1,4 @@
43 -# Copyright 1999-2016 Gentoo Foundation
44 +# Copyright 1999-2018 Gentoo Foundation
45 # Distributed under the terms of the GNU General Public License v2
46
47 from __future__ import division, print_function, unicode_literals
48 @@ -1817,7 +1817,7 @@ def action_info(settings, trees, myopts, myfiles):
49 myvars = list(settings)
50 else:
51 myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK',
52 - 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
53 + 'DISTDIR', 'ENV_UNSET', 'PKGDIR', 'PORTAGE_TMPDIR',
54 'PORTAGE_BUNZIP2_COMMAND',
55 'PORTAGE_BZIP2_COMMAND',
56 'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS',
57 diff --git a/pym/portage/const.py b/pym/portage/const.py
58 index 655be82b1..16922a5e6 100644
59 --- a/pym/portage/const.py
60 +++ b/pym/portage/const.py
61 @@ -1,5 +1,5 @@
62 # portage: Constants
63 -# Copyright 1998-2014 Gentoo Foundation
64 +# Copyright 1998-2018 Gentoo Foundation
65 # Distributed under the terms of the GNU General Public License v2
66
67 from __future__ import unicode_literals
68 @@ -89,6 +89,7 @@ INCREMENTALS = (
69 "ACCEPT_KEYWORDS",
70 "CONFIG_PROTECT",
71 "CONFIG_PROTECT_MASK",
72 + "ENV_UNSET",
73 "FEATURES",
74 "IUSE_IMPLICIT",
75 "PRELINK_PATH",
76 --
77 2.16.2