summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/repository/config.py10
-rw-r--r--pym/portage/tests/resolver/ResolverPlayground.py6
2 files changed, 8 insertions, 8 deletions
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 281173323..eb44b17f8 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -157,7 +157,7 @@ class RepoConfig(object):
repo_msg.append(indent + "sync: " + self.sync)
if self.masters:
repo_msg.append(indent + "masters: " + " ".join(master.name for master in self.masters))
- if self.priority:
+ if self.priority is not None:
repo_msg.append(indent + "priority: " + str(self.priority))
if self.aliases:
repo_msg.append(indent + "aliases: " + " ".join(self.aliases))
@@ -219,7 +219,7 @@ class RepoConfigLoader(object):
' '.join(prepos['DEFAULT'].masters)
if overlays:
#overlay priority is negative because we want them to be looked before any other repo
- base_priority = -1
+ base_priority = 0
for ov in overlays:
if os.path.isdir(ov):
repo_opts = default_repo_opts.copy()
@@ -249,10 +249,10 @@ class RepoConfigLoader(object):
repo = prepos[repo.name]
if repo.priority is None:
if ov == portdir and portdir not in port_ov:
- repo.priority = 1000
+ repo.priority = -1000
else:
repo.priority = base_priority
- base_priority -= 1
+ base_priority += 1
else:
writemsg(_("!!! Invalid PORTDIR_OVERLAY"
@@ -334,7 +334,7 @@ class RepoConfigLoader(object):
# items where repo.name == key
prepos_order = [repo.name for key, repo in prepos.items() \
if repo.name == key and repo.location is not None]
- prepos_order.sort(key=repo_priority, reverse=True)
+ prepos_order.sort(key=repo_priority)
if portdir in location_map:
portdir_repo = prepos[location_map[portdir]]
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 1289bb74b..5499d64eb 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -297,15 +297,15 @@ class ResolverPlayground(object):
repos_conf_file = os.path.join(user_config_dir, "repos.conf")
f = open(repos_conf_file, "w")
- priority = 999
+ 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)
+ f.write("PRIORITY=%s\n" % -1000)
else:
f.write("PRIORITY=%s\n" % priority)
- priority -= 1
+ priority += 1
f.close()
for config_file, lines in user_config.items():