-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import subprocess
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")
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import subprocess
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")
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",
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]
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("""
-# Copyright 2011 Gentoo Foundation
+# Copyright 2011-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import subprocess
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"))
"PATH" : os.environ["PATH"],
"PORTAGE_GRPNAME" : os.environ["PORTAGE_GRPNAME"],
"PORTAGE_USERNAME" : os.environ["PORTAGE_USERNAME"],
- "PORTDIR" : portdir,
+ "PORTDIR" : test_repo_location,
"PYTHONPATH" : pythonpath,
}
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:
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"))
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)
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)
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import textwrap
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)
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import textwrap
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)
-# Copyright 2012 Gentoo Foundation
+# Copyright 2012-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import re
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)