If there are not ebuilds matching a argument, only generate an error if there
authorZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 06:57:26 +0000 (06:57 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 30 Apr 2009 06:57:26 +0000 (06:57 -0000)
are also no cache entries matching the argument. (trunk r13287)

svn path=/main/branches/2.1.6/; revision=13458

bin/egencache

index 923bd16646efec03790012741c3b664528092a40..bbc59d8edab034136a4dc7bd3a8445f04de49df7 100755 (executable)
@@ -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: