diff options
author | Zac Medico <zmedico@gentoo.org> | 2018-12-29 16:21:17 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2018-12-29 16:59:46 -0800 |
commit | 17cb113abf2b155b7b1f2955f7eed54f335badb0 (patch) | |
tree | 4aeaaee508cc58082ef4b3e1a2d00a1e1c5ce347 | |
parent | Updates for portage-2.3.53 release (diff) | |
download | portage-17cb113abf2b155b7b1f2955f7eed54f335badb0.tar.gz portage-17cb113abf2b155b7b1f2955f7eed54f335badb0.tar.bz2 portage-17cb113abf2b155b7b1f2955f7eed54f335badb0.zip |
ResolverPlayground: exclude internal wrappers from essential_binaries PATH
Ensure that essential_binaries symlinks do not refer to internal
wrapper scripts, in order to avoid infinite recursion. Use the
same ebuild-helpers pattern as the portageq wrapper script since
daeb75b345c4433218ab9e7a5319e8914092f048.
Fixes: 1b5edbb5ec70 ("_doebuild_path: do not use host PATH by default and prepend EPREFIX PATH")
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | lib/portage/tests/resolver/ResolverPlayground.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py index 3997ad26e..626a1f064 100644 --- a/lib/portage/tests/resolver/ResolverPlayground.py +++ b/lib/portage/tests/resolver/ResolverPlayground.py @@ -108,8 +108,21 @@ class ResolverPlayground(object): "uniq", "xargs", ) - for x in essential_binaries: - os.symlink(find_binary(x), os.path.join(eubin, x)) + # Exclude internal wrappers from PATH lookup. + orig_path = os.environ['PATH'] + included_paths = [] + for path in orig_path.split(':'): + if path and not fnmatch.fnmatch(path, '*/portage/*/ebuild-helpers*'): + included_paths.append(path) + try: + os.environ['PATH'] = ':'.join(included_paths) + for x in essential_binaries: + path = find_binary(x) + if path is None: + raise portage.exception.CommandNotFound(x) + os.symlink(path, os.path.join(eubin, x)) + finally: + os.environ['PATH'] = orig_path else: self.eprefix = normalize_path(eprefix) |