aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2015-07-05 01:50:22 -0400
committerTim Harder <radhermit@gmail.com>2015-07-05 02:18:06 -0400
commit8a742457ca60bafc1fcfa1e2ad42814c922dd284 (patch)
treec81c5b5640d05c31fd57a3f1a2517f36a7e5e23e
parentsimplify requirements.txt (diff)
downloadpkgcore-8a742457ca60bafc1fcfa1e2ad42814c922dd284.tar.gz
pkgcore-8a742457ca60bafc1fcfa1e2ad42814c922dd284.tar.bz2
pkgcore-8a742457ca60bafc1fcfa1e2ad42814c922dd284.zip
repo: fix initial sync for new repos using repos.conf names
Previously specifying a new repo section in repos.conf and syncing against its section name wouldn't work, only using its location would; now either should work fine.
-rw-r--r--pkgcore/ebuild/portage_conf.py1
-rw-r--r--pkgcore/ebuild/repo_objs.py8
-rw-r--r--pkgcore/util/commandline.py2
3 files changed, 8 insertions, 3 deletions
diff --git a/pkgcore/ebuild/portage_conf.py b/pkgcore/ebuild/portage_conf.py
index d049664e1..07c57dd4a 100644
--- a/pkgcore/ebuild/portage_conf.py
+++ b/pkgcore/ebuild/portage_conf.py
@@ -451,6 +451,7 @@ def config_from_make_conf(location=None, profile_override=None, **kwargs):
# repo configs
conf = {
'class': 'pkgcore.ebuild.repo_objs.RepoConfig',
+ 'config_name': repo_name,
'location': repo_path,
'syncer': 'sync:' + repo_path,
}
diff --git a/pkgcore/ebuild/repo_objs.py b/pkgcore/ebuild/repo_objs.py
index 28507be85..205e3836a 100644
--- a/pkgcore/ebuild/repo_objs.py
+++ b/pkgcore/ebuild/repo_objs.py
@@ -345,9 +345,13 @@ class RepoConfig(syncable.tree):
pkgcore_config_type = ConfigHint(
typename='raw_repo',
- types={'syncer': 'lazy_ref:syncer'})
+ types={
+ 'config_name': 'str',
+ 'syncer': 'lazy_ref:syncer',
+ })
- def __init__(self, location, syncer=None, profiles_base='profiles'):
+ def __init__(self, location, config_name=None, syncer=None, profiles_base='profiles'):
+ object.__setattr__(self, 'config_name', config_name)
object.__setattr__(self, 'location', location)
object.__setattr__(self, 'profiles_base', pjoin(self.location, profiles_base))
syncable.tree.__init__(self, syncer)
diff --git a/pkgcore/util/commandline.py b/pkgcore/util/commandline.py
index e93613ec0..783683aae 100644
--- a/pkgcore/util/commandline.py
+++ b/pkgcore/util/commandline.py
@@ -332,7 +332,7 @@ class StoreRepoObject(StoreConfigObject):
# name wasn't found; search for it.
for repo_name, repo in sections.iteritems():
- if name in repo.aliases:
+ if name == repo.config_name or name in repo.aliases:
name = repo_name
break