From: Zac Medico Date: Sun, 5 Jun 2011 15:12:18 +0000 (-0700) Subject: MergeListItem: fix "unknown repo" display X-Git-Tag: v2.2.0_alpha38~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ee7bd00a6febac09bd97276e29bf7d1513ad2d84;p=portage.git MergeListItem: fix "unknown repo" display The Package class uses an UNKNOWN_REPO constant so that MergeListItem can distinguish this case. --- diff --git a/pym/_emerge/MergeListItem.py b/pym/_emerge/MergeListItem.py index 7de48f9d9..2176bf65a 100644 --- a/pym/_emerge/MergeListItem.py +++ b/pym/_emerge/MergeListItem.py @@ -64,7 +64,7 @@ class MergeListItem(CompositeTask): if portdir_repo_name: pkg_repo_name = pkg.repo if pkg_repo_name != portdir_repo_name: - if not pkg_repo_name: + if pkg_repo_name == pkg.UNKNOWN_REPO: pkg_repo_name = "unknown repo" msg += " from %s" % pkg_repo_name diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index cb476d68e..593e0d3eb 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -38,6 +38,7 @@ class Package(Task): _dep_keys = ('DEPEND', 'PDEPEND', 'RDEPEND',) _use_conditional_misc_keys = ('LICENSE', 'PROPERTIES', 'RESTRICT') + UNKNOWN_REPO = "__unknown__" def __init__(self, **kwargs): Task.__init__(self, **kwargs) @@ -69,7 +70,7 @@ class Package(Task): self.inherited = frozenset() repo = _gen_valid_repo(self.metadata.get('repository', '')) if not repo: - repo = '__unknown__' + repo = self.UNKNOWN_REPO self.metadata['repository'] = repo self._validate_deps()