diff options
author | 2015-06-24 22:03:54 -0400 | |
---|---|---|
committer | 2015-06-24 22:03:54 -0400 | |
commit | ddcdf9d3e66fabde63d7277a239562538c85ed1f (patch) | |
tree | fabaa4505bc43a2eb8bf396eb0805a49f467c496 | |
parent | bzr sync: use modern 'bzr branch' command (diff) | |
download | pkgcore-ddcdf9d3e66fabde63d7277a239562538c85ed1f.tar.gz pkgcore-ddcdf9d3e66fabde63d7277a239562538c85ed1f.tar.bz2 pkgcore-ddcdf9d3e66fabde63d7277a239562538c85ed1f.zip |
portage_conf: high values map to high priority levels for repos
This mirrors portage's current usage and docs.
-rw-r--r-- | pkgcore/ebuild/portage_conf.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgcore/ebuild/portage_conf.py b/pkgcore/ebuild/portage_conf.py index babfcc2b..5597f3a2 100644 --- a/pkgcore/ebuild/portage_conf.py +++ b/pkgcore/ebuild/portage_conf.py @@ -324,19 +324,21 @@ def load_repos_conf(path): repos[repo_name]['priority'] = int(priority) except ValueError: raise errors.ParsingError( - "%s: repo '%s' has invalid priority setting: %s" % (fp, repo_name, priority)) + "%s: repo '%s' has invalid priority setting: %s" % + (fp, repo_name, priority)) # only the location setting is strictly required if 'location' not in repos[repo_name]: raise errors.ParsingError( - "%s: repo '%s' missing location setting" % (fp, repo_name)) + "%s: repo '%s' missing location setting" % + (fp, repo_name)) # the default repo is gentoo if unset default_repo = defaults.get('main-repo', 'gentoo') - # the default repo has a high priority if unset or zero + # the default repo has a low priority if unset or zero if repos[default_repo]['priority'] == 0: - repos[default_repo]['priority'] = 9999 + repos[default_repo]['priority'] = -9999 del config return repos @@ -431,9 +433,9 @@ def config_from_make_conf(location="/etc/", profile_override=None, **kwargs): make_repo_syncers(config, repos_conf, make_conf) - # sort repos via priority + # sort repos via priority, in this case high values map to high priorities repos = [repo_opts['location'] for repo_opts in - sorted(repos_conf.itervalues(), key=lambda d: d['priority'])] + sorted(repos_conf.itervalues(), key=lambda d: d['priority'], reverse=True)] config['ebuild-repo-common'] = basics.AutoConfigSection({ 'class': 'pkgcore.ebuild.repository.slavedtree', |