From 7eacb07e5dab4e04cf8d4400c88966197a12a3ea Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 5 Oct 2010 15:14:10 -0700 Subject: [PATCH] Ensure that Package.repo is always valid. --- pym/_emerge/Package.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.26.2