* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/, pym/portage/tests/resolver/, pym/portage/tests/ebuild/
@ 2011-12-28 7:13 Zac Medico
0 siblings, 0 replies; 2+ messages in thread
From: Zac Medico @ 2011-12-28 7:13 UTC (permalink / raw
To: gentoo-commits
commit: e626628a338aa90f9cf321ec89789da72f67a9e0
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 28 07:13:41 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec 28 07:13:41 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e626628a
RepoConfig.update(): copy more attributes
This fixes a regression since commit
10246cd535f909dda8bd05de617c32d2b8a56b4a which caused layout.conf
settings such as thin-manifests to be ignored for repositories that
had repos.conf settings that did not specify the repository location.
In order to trigger this case, ResolverPlayground has been modified to
omit the location of each repository in the repos.conf file that it
generates.
---
pym/portage/repository/config.py | 13 ++++++++++---
pym/portage/tests/ebuild/test_config.py | 2 ++
pym/portage/tests/resolver/ResolverPlayground.py | 10 +++-------
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index f98b9b7..4bf995e 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -199,8 +199,9 @@ class RepoConfig(object):
def update(self, new_repo):
"""Update repository with options in another RepoConfig"""
- for k in ('aliases', 'eclass_overrides', 'location', 'masters',
- 'name', 'priority', 'sync', 'user_location'):
+ keys = set(self.__slots__)
+ keys.discard("missing_repo_name")
+ for k in keys:
v = getattr(new_repo, k, None)
if v is not None:
setattr(self, k, v)
@@ -324,7 +325,13 @@ class RepoConfigLoader(object):
repo_opts = default_repo_opts.copy()
repo_opts['location'] = ov
repo = RepoConfig(None, repo_opts)
- # repos_conf_opts contains options from /etc/portage/repos.conf
+ # repos_conf_opts may contain options from various places:
+ # 1) /etc/portage/repos.conf
+ # 2) $location/metadata/layout.conf if repos.conf specified
+ # the repo location
+ # 3) A RepoConfig instance corresponding to a previously
+ # processed path in the current list of overlays which
+ # referred to a repository with the same name.
repos_conf_opts = prepos.get(repo.name)
if repos_conf_opts is not None:
if repos_conf_opts.aliases is not None:
diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py
index 570cb2b..35694ed 100644
--- a/pym/portage/tests/ebuild/test_config.py
+++ b/pym/portage/tests/ebuild/test_config.py
@@ -243,6 +243,8 @@ class ConfigTestCase(TestCase):
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.thin_manifest, True,
+ "new_repo_config.thin_manifest != True")
new_manifest_file = os.path.join(playground.repo_dirs["new_repo"], "dev-libs", "A", "Manifest")
self.assertEqual(os.path.exists(new_manifest_file), False)
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 201c5c4..140b25d 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -376,17 +376,13 @@ class ResolverPlayground(object):
with open(os.path.join(metadata_dir, "metadata.xml"), 'w') as f:
f.write(herds_xml)
+ # Write empty entries for each repository, in order to exercise
+ # RepoConfigLoader's repos.conf processing.
repos_conf_file = os.path.join(user_config_dir, "repos.conf")
f = open(repos_conf_file, "w")
- priority = 0
for repo in sorted(self.repo_dirs.keys()):
f.write("[%s]\n" % repo)
- f.write("LOCATION=%s\n" % self.repo_dirs[repo])
- if repo == "test_repo":
- f.write("PRIORITY=%s\n" % -1000)
- else:
- f.write("PRIORITY=%s\n" % priority)
- priority += 1
+ f.write("\n")
f.close()
for config_file, lines in user_config.items():
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/repository/, pym/portage/tests/resolver/, pym/portage/tests/ebuild/
@ 2014-01-07 21:39 Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 2+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2014-01-07 21:39 UTC (permalink / raw
To: gentoo-commits
commit: c980aac3ed85d63f5e3fa96db249cd5076c50cbc
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Jan 7 21:38:29 2014 +0000
Commit: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
CommitDate: Tue Jan 7 21:38:29 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c980aac3
Use empty value of masters attribute in test suite when possible.
---
pym/portage/repository/config.py | 3 ++-
pym/portage/tests/ebuild/test_config.py | 3 ++-
pym/portage/tests/resolver/ResolverPlayground.py | 10 +++++++---
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 0d6edf4..71b75fb 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import unicode_literals
@@ -814,6 +814,7 @@ class RepoConfigLoader(object):
if repo._masters_orig is None and self.mainRepo() and \
repo.name != self.mainRepo().name and not portage._sync_disabled_warnings:
+ # TODO: Delete masters code in pym/portage/tests/resolver/ResolverPlayground.py when deleting this warning.
writemsg_level("!!! %s\n" % _("Repository '%s' is missing masters attribute in '%s'") %
(repo.name, os.path.join(repo.location, "metadata", "layout.conf")) +
"!!! %s\n" % _("Set 'masters = %s' in this file for future compatibility") %
diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py
index 7941bf2..08e0a5d 100644
--- a/pym/portage/tests/ebuild/test_config.py
+++ b/pym/portage/tests/ebuild/test_config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2013 Gentoo Foundation
+# Copyright 2010-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import portage
@@ -221,6 +221,7 @@ class ConfigTestCase(TestCase):
"profile-formats = pms",
"thin-manifests = true",
"manifest-hashes = SHA256 SHA512 WHIRLPOOL",
+ "# use implicit masters"
),
}
}
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 9577743..fabdefe 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -293,15 +293,19 @@ class ResolverPlayground(object):
with open(file_name, "w") as f:
for line in lines:
f.write("%s\n" % line)
+ # Temporarily write empty value of masters until it becomes default.
+ # TODO: Delete all references to "# use implicit masters" when empty value becomes default.
+ if config_file == "layout.conf" and not any(line.startswith(("masters =", "# use implicit masters")) for line in lines):
+ f.write("masters =\n")
#Create $profile_dir/eclass (we fail to digest the ebuilds if it's not there)
os.makedirs(os.path.join(repo_dir, "eclass"))
- # Set masters key in layout.conf for all repos except 'main-repo'
- if repo != "test_repo" and (not repo_config or "layout.conf" not in repo_config):
+ # Temporarily write empty value of masters until it becomes default.
+ if not repo_config or "layout.conf" not in repo_config:
layout_conf_path = os.path.join(repo_dir, "metadata", "layout.conf")
with open(layout_conf_path, "w") as f:
- f.write("masters = test_repo\n")
+ f.write("masters =\n")
if repo == "test_repo":
#Create a minimal profile in /usr/portage
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-07 21:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-07 21:39 [gentoo-commits] proj/portage:master commit in: pym/portage/repository/, pym/portage/tests/resolver/, pym/portage/tests/ebuild/ Arfrever Frehtes Taifersar Arahesis
-- strict thread matches above, loose matches on Subject: below --
2011-12-28 7:13 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox