summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-04-30 06:57:26 +0000
committerZac Medico <zmedico@gentoo.org>2009-04-30 06:57:26 +0000
commit07fc6e9c4be5a72bb4dd1ce1d4e4f675d56c8322 (patch)
tree36880713e8b78e994a7a6f7bdede2b1d78593422 /bin
parentGenerate an error if there are no ebuilds found for a package that's (diff)
downloadportage-multirepo-07fc6e9c4be5a72bb4dd1ce1d4e4f675d56c8322.tar.gz
portage-multirepo-07fc6e9c4be5a72bb4dd1ce1d4e4f675d56c8322.tar.bz2
portage-multirepo-07fc6e9c4be5a72bb4dd1ce1d4e4f675d56c8322.zip
If there are not ebuilds matching a argument, only generate an error if there
are also no cache entries matching the argument. (trunk r13287) svn path=/main/branches/2.1.6/; revision=13458
Diffstat (limited to 'bin')
-rwxr-xr-xbin/egencache29
1 files changed, 19 insertions, 10 deletions
diff --git a/bin/egencache b/bin/egencache
index 923bd166..bbc59d8e 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: