Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: James Le Cuirot <chewi@g.o>, Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] config.environ: always strip slash from SYSROOT (bug 654600)
Date: Thu, 03 May 2018 01:04:27
Message-Id: 20180503010338.8921-1-zmedico@gentoo.org
1 Since SYSROOT=/ interacts badly with autotools.eclass (bug 654600),
2 and no EAPI expects SYSROOT to have a trailing slash, always strip
3 the trailing slash from SYSROOT.
4
5 Bug: https://bugs.gentoo.org/654600
6 Fixes: a41dacf7926c ("Export SYSROOT and ESYSROOT in ebuild env in EAPI 7")
7 ---
8 pym/portage/package/ebuild/config.py | 9 +++++++--
9 1 file changed, 7 insertions(+), 2 deletions(-)
10
11 diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
12 index f9b257b86..96b2ebb71 100644
13 --- a/pym/portage/package/ebuild/config.py
14 +++ b/pym/portage/package/ebuild/config.py
15 @@ -2813,11 +2813,16 @@ class config(object):
16 mydict.pop("ECLASSDIR", None)
17
18 if not eapi_attrs.path_variables_end_with_trailing_slash:
19 - for v in ("D", "ED", "ROOT", "EROOT", "SYSROOT", "ESYSROOT",
20 - "BROOT"):
21 + for v in ("D", "ED", "ROOT", "EROOT", "ESYSROOT", "BROOT"):
22 if v in mydict:
23 mydict[v] = mydict[v].rstrip(os.path.sep)
24
25 + # Since SYSROOT=/ interacts badly with autotools.eclass (bug 654600),
26 + # and no EAPI expects SYSROOT to have a trailing slash, always strip
27 + # the trailing slash from SYSROOT.
28 + if 'SYSROOT' in mydict:
29 + mydict['SYSROOT'] = mydict['SYSROOT'].rstrip(os.path.sep)
30 +
31 try:
32 builddir = mydict["PORTAGE_BUILDDIR"]
33 distdir = mydict["DISTDIR"]
34 --
35 2.13.6

Replies