-# Copyright 2011-2012 Gentoo Foundation
+# Copyright 2011-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import tempfile
tempdir = tempfile.mkdtemp()
try:
- portdir = os.path.join(tempdir, "usr/portage")
- os.makedirs(portdir)
+ test_repo = os.path.join(tempdir, "var", "repositories", "test_repo")
+ os.makedirs(os.path.join(test_repo, "profiles"))
+ with open(os.path.join(test_repo, "profiles", "repo_name"), "w") as f:
+ f.write("test_repo")
env = {
- "PORTDIR": portdir,
+ "PORTAGE_REPOSITORIES": "[DEFAULT]\nmain-repo = test_repo\n[test_repo]\nlocation = %s" % test_repo
}
fakedb = fakedbapi(settings=config(config_profile_path="",
env=env, eprefix=tempdir))
try:
portage.util.noiselimit = -2
- license_group_locations = (os.path.join(playground.portdir, "profiles"),)
+ license_group_locations = (os.path.join(playground.settings.repositories["test_repo"].location, "profiles"),)
pkg_license = os.path.join(playground.eroot, "etc", "portage")
lic_man = LicenseManager(license_group_locations, pkg_license)
new_repo_config = settings.repositories["new_repo"]
old_repo_config = settings.repositories["old_repo"]
self.assertTrue(len(new_repo_config.masters) > 0, "new_repo has no default master")
- self.assertEqual(new_repo_config.masters[0].user_location, playground.portdir,
- "new_repo default master is not PORTDIR")
+ self.assertEqual(new_repo_config.masters[0].user_location, playground.settings.repositories["test_repo"].location,
+ "new_repo default master is not test_repo")
self.assertEqual(new_repo_config.thin_manifest, True,
"new_repo_config.thin_manifest != True")
self.target_root = os.sep
self.distdir = os.path.join(self.eroot, "var", "portage", "distfiles")
self.pkgdir = os.path.join(self.eprefix, "pkgdir")
- self.portdir = os.path.join(self.eroot, "usr/portage")
self.vdbdir = os.path.join(self.eroot, "var/db/pkg")
- os.makedirs(self.portdir)
os.makedirs(self.vdbdir)
if not debug:
"""
if repo not in self._repositories:
if repo == "test_repo":
- repo_path = self.portdir
self._repositories["DEFAULT"] = {"main-repo": repo}
- else:
- repo_path = os.path.join(self.eroot, "usr", "local", repo)
+ repo_path = os.path.join(self.eroot, "var", "repositories", repo)
self._repositories[repo] = {"location": repo_path}
profile_path = os.path.join(repo_path, "profiles")