summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-05 22:35:29 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-05 22:35:29 -0700
commitee7052a94cf2b14745ec1c83c5f8e8d322e008b2 (patch)
tree338ac317ef2fb7909405233859fd17a783185490
parentfdb147dd0a7e0c9ee6d3d4db00e606e00478c257 (diff)
downloadportage-ee7052a94cf2b14745ec1c83c5f8e8d322e008b2.tar.gz
portage-ee7052a94cf2b14745ec1c83c5f8e8d322e008b2.tar.bz2
portage-ee7052a94cf2b14745ec1c83c5f8e8d322e008b2.zip
Ensure valid Package.metadata['repository'].
-rw-r--r--pym/_emerge/Package.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 983a3bf9a..8cb9a6d32 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -27,7 +27,7 @@ class Package(Task):
"category", "counter", "cp", "cpv_split",
"inherited", "invalid", "iuse", "masks", "mtime",
"pf", "pv_split", "root", "slot", "slot_atom", "visible",) + \
- ("_raw_metadata", "_use", "_repo",)
+ ("_raw_metadata", "_use",)
metadata_keys = [
"BUILD_TIME", "CHOST", "COUNTER", "DEPEND", "EAPI",
@@ -65,6 +65,11 @@ class Package(Task):
self.pv_split = self.cpv_split[1:]
if self.inherited is None:
self.inherited = frozenset()
+ repo = _gen_valid_repo(self.metadata['repository'])
+ if not repo:
+ repo = '__unknown__'
+ self.metadata['repository'] = repo
+
self._validate_deps()
self.masks = self._masks()
self.visible = self._visible(self.masks)
@@ -316,11 +321,7 @@ class Package(Task):
@property
def repo(self):
- if self._repo is None:
- self._repo = _gen_valid_repo(self.metadata['repository'])
- if not self._repo:
- self._repo = '__unknown__'
- return self._repo
+ return self.metadata['repository']
@property
def use(self):