summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-05 15:14:10 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-05 15:14:10 -0700
commit7eacb07e5dab4e04cf8d4400c88966197a12a3ea (patch)
treea8c905e242a9d1227d4aba0fb807545581dc3ff2
parent3aab1f4ca10a7d9136c4176e6a69e29bb84beea9 (diff)
downloadportage-7eacb07e5dab4e04cf8d4400c88966197a12a3ea.tar.gz
portage-7eacb07e5dab4e04cf8d4400c88966197a12a3ea.tar.bz2
portage-7eacb07e5dab4e04cf8d4400c88966197a12a3ea.zip
Ensure that Package.repo is always valid.
-rw-r--r--pym/_emerge/Package.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index ae82c5246..983a3bf9a 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -11,6 +11,7 @@ from portage.dep import Atom, check_required_use, use_reduce, \
paren_enclose, _slot_re, _slot_separator, _repo_separator
from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use
from portage.exception import InvalidDependString
+from portage.repository.config import _gen_valid_repo
from _emerge.Task import Task
if sys.hexversion >= 0x3000000:
@@ -316,7 +317,9 @@ class Package(Task):
@property
def repo(self):
if self._repo is None:
- self._repo = self.metadata['repository']
+ self._repo = _gen_valid_repo(self.metadata['repository'])
+ if not self._repo:
+ self._repo = '__unknown__'
return self._repo
@property