From: Arfrever Frehtes Taifersar Arahesis Date: Sat, 13 Jul 2013 00:39:15 +0000 (+0200) Subject: Stop using config["PORTDIR"] in some tests. X-Git-Tag: v2.2.0_alpha189~63 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=720144837004a9b2ac9e4352f62c1bb388524105;p=portage.git Stop using config["PORTDIR"] in some tests. --- diff --git a/pym/portage/tests/dbapi/test_portdb_cache.py b/pym/portage/tests/dbapi/test_portdb_cache.py index b9f9fed5a..e5270c526 100644 --- a/pym/portage/tests/dbapi/test_portdb_cache.py +++ b/pym/portage/tests/dbapi/test_portdb_cache.py @@ -1,4 +1,4 @@ -# Copyright 2012 Gentoo Foundation +# Copyright 2012-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import subprocess @@ -29,9 +29,9 @@ class PortdbCacheTestCase(TestCase): playground = ResolverPlayground(ebuilds=ebuilds, debug=debug) settings = playground.settings eprefix = settings["EPREFIX"] - portdir = settings["PORTDIR"] + test_repo_location = settings.repositories["test_repo"].location user_config_dir = os.path.join(eprefix, USER_CONFIG_PATH) - metadata_dir = os.path.join(portdir, "metadata") + metadata_dir = os.path.join(test_repo_location, "metadata") md5_cache_dir = os.path.join(metadata_dir, "md5-cache") pms_cache_dir = os.path.join(metadata_dir, "cache") layout_conf_path = os.path.join(metadata_dir, "layout.conf") diff --git a/pym/portage/tests/emerge/test_emerge_slot_abi.py b/pym/portage/tests/emerge/test_emerge_slot_abi.py index 401c23bbf..949caf311 100644 --- a/pym/portage/tests/emerge/test_emerge_slot_abi.py +++ b/pym/portage/tests/emerge/test_emerge_slot_abi.py @@ -1,4 +1,4 @@ -# Copyright 2012 Gentoo Foundation +# Copyright 2012-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import subprocess @@ -64,7 +64,6 @@ class SlotAbiEmergeTestCase(TestCase): trees = playground.trees portdb = trees[eroot]["porttree"].dbapi vardb = trees[eroot]["vartree"].dbapi - portdir = settings["PORTDIR"] var_cache_edb = os.path.join(eprefix, "var", "cache", "edb") user_config_dir = os.path.join(eprefix, USER_CONFIG_PATH) package_mask_path = os.path.join(user_config_dir, "package.mask") diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py index bbff6d80d..a74e646ad 100644 --- a/pym/portage/tests/emerge/test_simple.py +++ b/pym/portage/tests/emerge/test_simple.py @@ -168,10 +168,10 @@ pkg_preinst() { eroot = settings["EROOT"] trees = playground.trees portdb = trees[eroot]["porttree"].dbapi - portdir = settings["PORTDIR"] + test_repo_location = settings.repositories["test_repo"].location var_cache_edb = os.path.join(eprefix, "var", "cache", "edb") cachedir = os.path.join(var_cache_edb, "dep") - cachedir_pregen = os.path.join(portdir, "metadata", "md5-cache") + cachedir_pregen = os.path.join(test_repo_location, "metadata", "md5-cache") portage_python = portage._python_interpreter dispatch_conf_cmd = (portage_python, "-Wd", @@ -346,7 +346,7 @@ pkg_preinst() { env["__PORTAGE_TEST_HARDLINK_LOCKS"] = \ os.environ["__PORTAGE_TEST_HARDLINK_LOCKS"] - updates_dir = os.path.join(portdir, "profiles", "updates") + updates_dir = os.path.join(test_repo_location, "profiles", "updates") dirs = [cachedir, cachedir_pregen, distdir, fake_bin, portage_tmpdir, updates_dir, user_config_dir, var_cache_edb] @@ -372,7 +372,7 @@ pkg_preinst() { with open(os.path.join(profile_path, "packages"), 'w') as f: f.write("*dev-libs/token-system-pkg") for cp, xml_data in metadata_xml_files: - with open(os.path.join(portdir, cp, "metadata.xml"), 'w') as f: + with open(os.path.join(test_repo_location, cp, "metadata.xml"), 'w') as f: f.write(playground.metadata_xml_template % xml_data) with open(os.path.join(updates_dir, "1Q-2010"), 'w') as f: f.write(""" diff --git a/pym/portage/tests/repoman/test_simple.py b/pym/portage/tests/repoman/test_simple.py index 420297caa..83227a9c5 100644 --- a/pym/portage/tests/repoman/test_simple.py +++ b/pym/portage/tests/repoman/test_simple.py @@ -1,4 +1,4 @@ -# Copyright 2011 Gentoo Foundation +# Copyright 2011-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import subprocess @@ -166,9 +166,9 @@ class SimpleRepomanTestCase(TestCase): portdb = playground.trees[playground.eroot]["porttree"].dbapi homedir = os.path.join(eroot, "home") distdir = os.path.join(eprefix, "distdir") - portdir = settings["PORTDIR"] - profiles_dir = os.path.join(portdir, "profiles") - license_dir = os.path.join(portdir, "licenses") + test_repo_location = settings.repositories["test_repo"].location + profiles_dir = os.path.join(test_repo_location, "profiles") + license_dir = os.path.join(test_repo_location, "licenses") repoman_cmd = (portage._python_interpreter, "-Wd", os.path.join(PORTAGE_BIN_PATH, "repoman")) @@ -228,7 +228,7 @@ class SimpleRepomanTestCase(TestCase): "PATH" : os.environ["PATH"], "PORTAGE_GRPNAME" : os.environ["PORTAGE_GRPNAME"], "PORTAGE_USERNAME" : os.environ["PORTAGE_USERNAME"], - "PORTDIR" : portdir, + "PORTDIR" : test_repo_location, "PYTHONPATH" : pythonpath, } @@ -240,7 +240,7 @@ class SimpleRepomanTestCase(TestCase): try: for d in dirs: ensure_dirs(d) - with open(os.path.join(portdir, "skel.ChangeLog"), 'w') as f: + with open(os.path.join(test_repo_location, "skel.ChangeLog"), 'w') as f: f.write(copyright_header) with open(os.path.join(profiles_dir, "profiles.desc"), 'w') as f: for x in profiles: @@ -266,12 +266,12 @@ class SimpleRepomanTestCase(TestCase): for k, v in use_desc: f.write("%s - %s\n" % (k, v)) for cp, xml_data in metadata_xml_files: - with open(os.path.join(portdir, cp, "metadata.xml"), 'w') as f: + with open(os.path.join(test_repo_location, cp, "metadata.xml"), 'w') as f: f.write(playground.metadata_xml_template % xml_data) - # Use a symlink to portdir, in order to trigger bugs + # Use a symlink to test_repo, in order to trigger bugs # involving canonical vs. non-canonical paths. - portdir_symlink = os.path.join(eroot, "portdir_symlink") - os.symlink(portdir, portdir_symlink) + test_repo_symlink = os.path.join(eroot, "test_repo_symlink") + os.symlink(test_repo_location, test_repo_symlink) # repoman checks metadata.dtd for recent CTIME, so copy the file in # order to ensure that the CTIME is current shutil.copyfile(metadata_dtd, os.path.join(distdir, "metadata.dtd")) @@ -286,7 +286,7 @@ class SimpleRepomanTestCase(TestCase): stdout = subprocess.PIPE for cwd in ("", "dev-libs", "dev-libs/A", "dev-libs/B"): - abs_cwd = os.path.join(portdir_symlink, cwd) + abs_cwd = os.path.join(test_repo_symlink, cwd) proc = subprocess.Popen([portage._python_interpreter, "-Wd", os.path.join(PORTAGE_BIN_PATH, "repoman"), "full"], cwd=abs_cwd, env=env, stdout=stdout) @@ -306,7 +306,7 @@ class SimpleRepomanTestCase(TestCase): if git_binary is not None: for cwd, cmd in git_test: - abs_cwd = os.path.join(portdir_symlink, cwd) + abs_cwd = os.path.join(test_repo_symlink, cwd) proc = subprocess.Popen(cmd, cwd=abs_cwd, env=env, stdout=stdout) diff --git a/pym/portage/tests/update/test_move_ent.py b/pym/portage/tests/update/test_move_ent.py index 2504dee2b..d9647a95e 100644 --- a/pym/portage/tests/update/test_move_ent.py +++ b/pym/portage/tests/update/test_move_ent.py @@ -1,4 +1,4 @@ -# Copyright 2012 Gentoo Foundation +# Copyright 2012-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import textwrap @@ -59,12 +59,12 @@ class MoveEntTestCase(TestCase): settings = playground.settings trees = playground.trees eroot = settings["EROOT"] - portdir = settings["PORTDIR"] + test_repo_location = settings.repositories["test_repo"].location portdb = trees[eroot]["porttree"].dbapi vardb = trees[eroot]["vartree"].dbapi bindb = trees[eroot]["bintree"].dbapi - updates_dir = os.path.join(portdir, "profiles", "updates") + updates_dir = os.path.join(test_repo_location, "profiles", "updates") try: ensure_dirs(updates_dir) diff --git a/pym/portage/tests/update/test_move_slot_ent.py b/pym/portage/tests/update/test_move_slot_ent.py index fcb0cc64c..3e49e1144 100644 --- a/pym/portage/tests/update/test_move_slot_ent.py +++ b/pym/portage/tests/update/test_move_slot_ent.py @@ -1,4 +1,4 @@ -# Copyright 2012 Gentoo Foundation +# Copyright 2012-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import textwrap @@ -94,12 +94,12 @@ class MoveSlotEntTestCase(TestCase): settings = playground.settings trees = playground.trees eroot = settings["EROOT"] - portdir = settings["PORTDIR"] + test_repo_location = settings.repositories["test_repo"].location portdb = trees[eroot]["porttree"].dbapi vardb = trees[eroot]["vartree"].dbapi bindb = trees[eroot]["bintree"].dbapi - updates_dir = os.path.join(portdir, "profiles", "updates") + updates_dir = os.path.join(test_repo_location, "profiles", "updates") try: ensure_dirs(updates_dir) diff --git a/pym/portage/tests/update/test_update_dbentry.py b/pym/portage/tests/update/test_update_dbentry.py index 39b8e665d..88951149a 100644 --- a/pym/portage/tests/update/test_update_dbentry.py +++ b/pym/portage/tests/update/test_update_dbentry.py @@ -1,4 +1,4 @@ -# Copyright 2012 Gentoo Foundation +# Copyright 2012-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import re @@ -189,14 +189,14 @@ class UpdateDbentryTestCase(TestCase): settings = playground.settings trees = playground.trees eroot = settings["EROOT"] - portdir = settings["PORTDIR"] + test_repo_location = settings.repositories["test_repo"].location portdb = trees[eroot]["porttree"].dbapi vardb = trees[eroot]["vartree"].dbapi bindb = trees[eroot]["bintree"].dbapi setconfig = trees[eroot]["root_config"].setconfig selected_set = setconfig.getSets()["selected"] - updates_dir = os.path.join(portdir, "profiles", "updates") + updates_dir = os.path.join(test_repo_location, "profiles", "updates") try: ensure_dirs(updates_dir)