emerge/test_simple.py: override PATH more
authorZac Medico <zmedico@gentoo.org>
Thu, 10 Jan 2013 12:03:45 +0000 (04:03 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 10 Jan 2013 12:06:06 +0000 (04:06 -0800)
Override things that may be unavailable, or may have portability
issues when running tests in exotic environments.

pym/portage/package/ebuild/doebuild.py
pym/portage/tests/emerge/test_simple.py

index 76f908ddd370c08247018659b552e89d3ea374c1..e4d3ae4514df591048b16a12c68ba320d0a3650a 100644 (file)
@@ -160,13 +160,15 @@ def _doebuild_path(settings, eapi=None):
        eprefix = settings["EPREFIX"]
        prerootpath = [x for x in settings.get("PREROOTPATH", "").split(":") if x]
        rootpath = [x for x in settings.get("ROOTPATH", "").split(":") if x]
+       overrides = [x for x in settings.get(
+               "__PORTAGE_TEST_PATH_OVERRIDE", "").split(":") if x]
 
        prefixes = []
        if eprefix:
                prefixes.append(eprefix)
        prefixes.append("/")
 
-       path = []
+       path = overrides
 
        if eprefix and uid != 0 and "fakeroot" not in settings.features:
                path.append(os.path.join(portage_bin_path,
index a22e2b37d3dfecf45c5e1ddfec99ec07fe064a22..282a045edade4a9263194d584463ddead9f7c1ee 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2011-2012 Gentoo Foundation
+# Copyright 2011-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import subprocess
@@ -302,6 +302,7 @@ pkg_preinst() {
                        "PORTAGE_PYTHON" : portage_python,
                        "PORTAGE_TMPDIR" : portage_tmpdir,
                        "PYTHONPATH" : pythonpath,
+                       "__PORTAGE_TEST_PATH_OVERRIDE" : fake_bin,
                }
 
                if "__PORTAGE_TEST_HARDLINK_LOCKS" in os.environ:
@@ -312,7 +313,10 @@ pkg_preinst() {
                dirs = [cachedir, cachedir_pregen, distdir, fake_bin,
                        portage_tmpdir, updates_dir,
                        user_config_dir, var_cache_edb]
-               true_symlinks = ["chown", "chgrp"]
+               # Override things that may be unavailable, or may have portability
+               # issues when running tests in exotic environments.
+               #   prepstrip - bug #447810 (bash read builtin EINTR problem)
+               true_symlinks = ["find", "gawk", "prepstrip", "sed", "scanelf"]
                true_binary = find_binary("true")
                self.assertEqual(true_binary is None, False,
                        "true command not found")