From: Zac Medico Date: Tue, 5 Oct 2010 22:14:10 +0000 (-0700) Subject: Ensure that Package.repo is always valid. X-Git-Tag: v2.2_rc90~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7eacb07e5dab4e04cf8d4400c88966197a12a3ea;p=portage.git Ensure that Package.repo is always valid. --- 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