1 |
Author: zmedico |
2 |
Date: 2009-04-30 06:57:04 +0000 (Thu, 30 Apr 2009) |
3 |
New Revision: 13457 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/bin/egencache |
7 |
Log: |
8 |
Generate an error if there are no ebuilds found for a package that's |
9 |
specified on the commandline. (trunk r13282) |
10 |
|
11 |
Modified: main/branches/2.1.6/bin/egencache |
12 |
=================================================================== |
13 |
--- main/branches/2.1.6/bin/egencache 2009-04-30 06:56:43 UTC (rev 13456) |
14 |
+++ main/branches/2.1.6/bin/egencache 2009-04-30 06:57:04 UTC (rev 13457) |
15 |
@@ -116,8 +116,10 @@ |
16 |
if cp_iter is not None: |
17 |
self._cp_set = set(cp_iter) |
18 |
cp_iter = iter(self._cp_set) |
19 |
+ self._cp_missing = self._cp_set.copy() |
20 |
else: |
21 |
self._cp_set = None |
22 |
+ self._cp_missing = set() |
23 |
self._regen = _emerge.MetadataRegen(portdb, cp_iter=cp_iter, |
24 |
consumer=self._metadata_callback, |
25 |
max_jobs=max_jobs, max_load=max_load) |
26 |
@@ -131,6 +133,7 @@ |
27 |
|
28 |
def _metadata_callback(self, cpv, ebuild_path, repo_path, metadata): |
29 |
self._existing_nodes.add(cpv) |
30 |
+ self._cp_missing.discard(portage.cpv_getkey(cpv)) |
31 |
if metadata is not None: |
32 |
if metadata.get('EAPI') == '0': |
33 |
del metadata['EAPI'] |
34 |
@@ -174,6 +177,13 @@ |
35 |
self._regen.run() |
36 |
self.returncode |= self._regen.returncode |
37 |
|
38 |
+ if self._cp_missing: |
39 |
+ self.returncode |= 1 |
40 |
+ for cp in sorted(self._cp_missing): |
41 |
+ writemsg_level( |
42 |
+ "No ebuilds found for '%s'\n" % (cp,), |
43 |
+ level=logging.ERROR, noiselevel=-1) |
44 |
+ |
45 |
trg_cache = self._trg_cache |
46 |
dead_nodes = None |
47 |
if self._global_cleanse: |