Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 516934 Details for
Bug 645914
virtual deps no longer correctly satisfied when using ||() deps
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
modified version of pym/portage/tests/emerge/test_simple.py
test_emerge_virtual_target_os.py (text/x-python), 4.38 KB, created by
Zac Medico
on 2018-01-28 02:38:58 UTC
(
hide
)
Description:
modified version of pym/portage/tests/emerge/test_simple.py
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2018-01-28 02:38:58 UTC
Size:
4.38 KB
patch
obsolete
># Copyright 2011-2018 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 > >import subprocess >import sys > >import portage >from portage import os >from portage import _unicode_decode >from portage.const import (BASH_BINARY, PORTAGE_BASE_PATH, > PORTAGE_PYM_PATH, USER_CONFIG_PATH) >from portage.process import find_binary >from portage.tests import TestCase >from portage.tests.resolver.ResolverPlayground import ResolverPlayground >from portage.util import (ensure_dirs, find_updated_config_files, > shlex_split) > >class SimpleEmergeTestCase(TestCase): > > def testSimple(self): > > debug = True > > binpkgs = { > 'app-eselect/eselect-awk-0.2': {}, > 'sys-apps/gawk-4.1.4': { > 'RDEPEND': 'sys-libs/readline' > }, > 'sys-apps/mawk-1.3.4_p20171017-r1': { > 'RDEPEND': 'app-eselect/eselect-awk' > }, > 'sys-libs/ncurses-6.0-r2': {}, > 'sys-libs/readline-7.0_p3': { > 'RDEPEND': 'sys-libs/ncurses' > }, > 'virtual/awk-1': { > 'RDEPEND': '|| ( >=sys-apps/gawk-4.0.1-r1 sys-apps/mawk )' > }, > 'virtual/implicit-system-1': { > 'EAPI': '5', > 'RDEPEND': 'sys-apps/mawk' > }, > 'virtual/target-os-1': { > 'EAPI': '5', > 'RDEPEND': '|| ( virtual/implicit-system virtual/awk )' > }, > } > > playground = ResolverPlayground( > binpkgs=binpkgs, debug=debug) > settings = playground.settings > eprefix = settings["EPREFIX"] > eroot = settings["EROOT"] > > portage_python = portage._python_interpreter > emerge_cmd = (portage_python, "-b", "-Wd", > os.path.join(self.bindir, "emerge")) > > cross_prefix = os.path.join(eprefix, "cross_prefix") > cross_root = os.path.join(eprefix, "cross_root") > cross_eroot = os.path.join(cross_root, eprefix.lstrip(os.sep)) > > test_commands = ( > ({"ROOT": cross_root},) + emerge_cmd + ("-peKt", "virtual/target-os"), > #({"ROOT": cross_root},) + emerge_cmd + ("-peKt", "sys-apps/gawk", "virtual/target-os"), > ) > > distdir = playground.distdir > pkgdir = playground.pkgdir > fake_bin = os.path.join(eprefix, "bin") > portage_tmpdir = os.path.join(eprefix, "var", "tmp", "portage") > profile_path = settings.profile_path > > path = os.environ.get("PATH") > if path is not None and not path.strip(): > path = None > if path is None: > path = "" > else: > path = ":" + path > path = fake_bin + path > > pythonpath = os.environ.get("PYTHONPATH") > if pythonpath is not None and not pythonpath.strip(): > pythonpath = None > if pythonpath is not None and \ > pythonpath.split(":")[0] == PORTAGE_PYM_PATH: > pass > else: > if pythonpath is None: > pythonpath = "" > else: > pythonpath = ":" + pythonpath > pythonpath = PORTAGE_PYM_PATH + pythonpath > > env = { > "PORTAGE_OVERRIDE_EPREFIX" : eprefix, > "CLEAN_DELAY" : "0", > "DISTDIR" : distdir, > "EMERGE_WARNING_DELAY" : "0", > "INFODIR" : "", > "INFOPATH" : "", > "PATH" : path, > "PKGDIR" : pkgdir, > "PORTAGE_INST_GID" : str(portage.data.portage_gid), > "PORTAGE_INST_UID" : str(portage.data.portage_uid), > "PORTAGE_PYTHON" : portage_python, > "PORTAGE_REPOSITORIES" : settings.repositories.config_string(), > "PORTAGE_TMPDIR" : portage_tmpdir, > "PORT_LOGDIR" : portage_tmpdir, > "PYTHONDONTWRITEBYTECODE" : os.environ.get("PYTHONDONTWRITEBYTECODE", ""), > "PYTHONPATH" : pythonpath, > "__PORTAGE_TEST_PATH_OVERRIDE" : fake_bin, > } > > dirs = [cross_eroot, cross_prefix, > distdir, fake_bin, portage_tmpdir] > > try: > for d in dirs: > ensure_dirs(d) > with open(os.path.join(os.path.join(eprefix, "var", "cache", "edb"), > "counter"), 'wb') as f: > f.write(b"100") > > if debug: > # The subprocess inherits both stdout and stderr, for > # debugging purposes. > stdout = None > else: > # The subprocess inherits stderr so that any warnings > # triggered by python -Wd will be visible. > stdout = subprocess.PIPE > > for args in test_commands: > > if hasattr(args, '__call__'): > args() > continue > > if isinstance(args[0], dict): > local_env = env.copy() > local_env.update(args[0]) > args = args[1:] > else: > local_env = env > > proc = subprocess.Popen(args, > env=local_env, stdout=stdout) > > if debug: > proc.wait() > else: > output = proc.stdout.readlines() > proc.wait() > proc.stdout.close() > if proc.returncode != os.EX_OK: > for line in output: > sys.stderr.write(_unicode_decode(line)) > > self.assertEqual(os.EX_OK, proc.returncode, > "emerge failed with args %s" % (args,)) > finally: > playground.debug = False > playground.cleanup()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 645914
:
516924
|
516926
|
516934
|
516936