aboutsummaryrefslogtreecommitdiff
path: root/pomu
diff options
context:
space:
mode:
authorMykyta Holubakha <hilobakho@gmail.com>2017-06-03 12:35:14 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2017-06-03 12:35:14 +0300
commitc51d2ac226e5b70b3281552483e07b3dcc733e22 (patch)
treecec06cd817881275faa02f423afbc09ade82ff32 /pomu
parentAdd missing imports (diff)
downloadpomu-c51d2ac226e5b70b3281552483e07b3dcc733e22.tar.gz
pomu-c51d2ac226e5b70b3281552483e07b3dcc733e22.tar.bz2
pomu-c51d2ac226e5b70b3281552483e07b3dcc733e22.zip
Assure that portage repo initialization tests pass
Diffstat (limited to 'pomu')
-rw-r--r--pomu/repo/repo.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pomu/repo/repo.py b/pomu/repo/repo.py
index e8693ce..065c990 100644
--- a/pomu/repo/repo.py
+++ b/pomu/repo/repo.py
@@ -3,15 +3,18 @@ from os import path
import portage
-rsets = portage.db[portage.root]['vartree'].settings.repositories
-
def portage_repos():
+ """Yield the repositories configured for portage"""
+ rsets = portage.db[portage.root]['vartree'].settings.repositories
+
for repo in rsets.prepos_order:
yield repo
def portage_repo_path(repo):
"""Get the path of a given portage repository"""
- if repo in rsets.prepos_order:
+ rsets = portage.db[portage.root]['vartree'].settings.repositories
+
+ if repo in rsets.prepos:
return rsets.prepos[repo].location
return None
@@ -20,6 +23,7 @@ def pomu_status(repo_path):
return path.isdir(path.join(repo_path, 'metadata', 'pomu'))
def pomu_active_repo():
+ """Returns a portage repo, for which pomu is enabled"""
for repo in portage_repos():
if pomu_status(portage_repo_path(repo)):
return repo