From ee7bd00a6febac09bd97276e29bf7d1513ad2d84 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 5 Jun 2011 08:12:18 -0700 Subject: [PATCH] MergeListItem: fix "unknown repo" display The Package class uses an UNKNOWN_REPO constant so that MergeListItem can distinguish this case. --- pym/_emerge/MergeListItem.py | 2 +- pym/_emerge/Package.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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() -- 2.26.2