From 82790342968d2a0ccd3fa728d5212d5e762b2f03 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 3 Apr 2009 18:51:22 +0000 Subject: [PATCH] If there are not ebuilds matching a argument, only generate an error if there are also no cache entries matching the argument. svn path=/main/trunk/; revision=13287 --- bin/egencache | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/bin/egencache b/bin/egencache index 923bd1664..bbc59d8ed 100755 --- a/bin/egencache +++ b/bin/egencache @@ -176,13 +176,7 @@ class GenCache(object): def run(self): self._regen.run() self.returncode |= self._regen.returncode - - if self._cp_missing: - self.returncode |= 1 - for cp in sorted(self._cp_missing): - writemsg_level( - "No ebuilds found for '%s'\n" % (cp,), - level=logging.ERROR, noiselevel=-1) + cp_missing = self._cp_missing trg_cache = self._trg_cache dead_nodes = None @@ -200,10 +194,18 @@ class GenCache(object): else: cp_set = self._cp_set cpv_getkey = portage.cpv_getkey + dead_nodes = set() try: - dead_nodes = set(cpv for cpv in \ - trg_cache.iterkeys() \ - if cpv_getkey(cpv) in cp_set) + for cpv in trg_cache.iterkeys(): + cp = cpv_getkey(cpv) + if cp is None: + writemsg_level( + "Unable to parse cp for '%s'\n" % (cpv,), + level=logging.ERROR, noiselevel=-1) + else: + cp_missing.discard(cp) + if cp in cp_set: + dead_nodes.add(cpv) except CacheError, ce: self.returncode |= 1 writemsg_level( @@ -212,6 +214,13 @@ class GenCache(object): (self._portdb.porttree_root, ce), level=logging.ERROR, noiselevel=-1) + if cp_missing: + self.returncode |= 1 + for cp in sorted(cp_missing): + writemsg_level( + "No ebuilds or cache entries found for '%s'\n" % (cp,), + level=logging.ERROR, noiselevel=-1) + if dead_nodes: dead_nodes.difference_update(self._existing_nodes) for k in dead_nodes: -- 2.26.2