1 |
commit: 437c0f1987fa770bd2edf31f1a5a1812391e37fd |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Nov 24 21:14:32 2012 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 24 21:14:32 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=437c0f19 |
7 |
|
8 |
emerge --info: report unmatched atom, bug #444596 |
9 |
|
10 |
--- |
11 |
pym/_emerge/actions.py | 81 ++++++++++++++++++++++++++++-------------------- |
12 |
1 files changed, 47 insertions(+), 34 deletions(-) |
13 |
|
14 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
15 |
index 2b3e57e..b1feba6 100644 |
16 |
--- a/pym/_emerge/actions.py |
17 |
+++ b/pym/_emerge/actions.py |
18 |
@@ -1357,6 +1357,53 @@ class _info_pkgs_ver(object): |
19 |
|
20 |
def action_info(settings, trees, myopts, myfiles): |
21 |
|
22 |
+ # See if we can find any packages installed matching the strings |
23 |
+ # passed on the command line |
24 |
+ mypkgs = [] |
25 |
+ eroot = settings['EROOT'] |
26 |
+ vardb = trees[eroot]["vartree"].dbapi |
27 |
+ portdb = trees[eroot]['porttree'].dbapi |
28 |
+ bindb = trees[eroot]["bintree"].dbapi |
29 |
+ for x in myfiles: |
30 |
+ match_found = False |
31 |
+ installed_match = vardb.match(x) |
32 |
+ for installed in installed_match: |
33 |
+ mypkgs.append((installed, "installed")) |
34 |
+ match_found = True |
35 |
+ |
36 |
+ if match_found: |
37 |
+ continue |
38 |
+ |
39 |
+ for db, pkg_type in ((portdb, "ebuild"), (bindb, "binary")): |
40 |
+ if pkg_type == "binary" and "--usepkg" not in myopts: |
41 |
+ continue |
42 |
+ |
43 |
+ matches = db.match(x) |
44 |
+ matches.reverse() |
45 |
+ for match in matches: |
46 |
+ if pkg_type == "binary": |
47 |
+ if db.bintree.isremote(match): |
48 |
+ continue |
49 |
+ auxkeys = ["EAPI", "DEFINED_PHASES"] |
50 |
+ metadata = dict(zip(auxkeys, db.aux_get(match, auxkeys))) |
51 |
+ if metadata["EAPI"] not in ("0", "1", "2", "3") and \ |
52 |
+ "info" in metadata["DEFINED_PHASES"].split(): |
53 |
+ mypkgs.append((match, pkg_type)) |
54 |
+ match_found = True |
55 |
+ break |
56 |
+ |
57 |
+ if not match_found: |
58 |
+ xinfo = '"%s"' % x.unevaluated_atom |
59 |
+ # Discard null/ from failed cpv_expand category expansion. |
60 |
+ xinfo = xinfo.replace("null/", "") |
61 |
+ if settings["ROOT"] != "/": |
62 |
+ xinfo = "%s for %s" % (xinfo, eroot) |
63 |
+ writemsg("\nemerge: there are no ebuilds to satisfy %s.\n" % |
64 |
+ colorize("INFORM", xinfo), noiselevel=-1) |
65 |
+ # TODO: Split out --misspell-suggestions code from depgraph |
66 |
+ # and call it here. |
67 |
+ return 1 |
68 |
+ |
69 |
output_buffer = [] |
70 |
append = output_buffer.append |
71 |
root_config = trees[settings['EROOT']]['root_config'] |
72 |
@@ -1563,40 +1610,6 @@ def action_info(settings, trees, myopts, myfiles): |
73 |
writemsg_stdout("\n".join(output_buffer), |
74 |
noiselevel=-1) |
75 |
|
76 |
- # See if we can find any packages installed matching the strings |
77 |
- # passed on the command line |
78 |
- mypkgs = [] |
79 |
- eroot = settings['EROOT'] |
80 |
- vardb = trees[eroot]["vartree"].dbapi |
81 |
- portdb = trees[eroot]['porttree'].dbapi |
82 |
- bindb = trees[eroot]["bintree"].dbapi |
83 |
- for x in myfiles: |
84 |
- match_found = False |
85 |
- installed_match = vardb.match(x) |
86 |
- for installed in installed_match: |
87 |
- mypkgs.append((installed, "installed")) |
88 |
- match_found = True |
89 |
- |
90 |
- if match_found: |
91 |
- continue |
92 |
- |
93 |
- for db, pkg_type in ((portdb, "ebuild"), (bindb, "binary")): |
94 |
- if pkg_type == "binary" and "--usepkg" not in myopts: |
95 |
- continue |
96 |
- |
97 |
- matches = db.match(x) |
98 |
- matches.reverse() |
99 |
- for match in matches: |
100 |
- if pkg_type == "binary": |
101 |
- if db.bintree.isremote(match): |
102 |
- continue |
103 |
- auxkeys = ["EAPI", "DEFINED_PHASES"] |
104 |
- metadata = dict(zip(auxkeys, db.aux_get(match, auxkeys))) |
105 |
- if metadata["EAPI"] not in ("0", "1", "2", "3") and \ |
106 |
- "info" in metadata["DEFINED_PHASES"].split(): |
107 |
- mypkgs.append((match, pkg_type)) |
108 |
- break |
109 |
- |
110 |
# If some packages were found... |
111 |
if mypkgs: |
112 |
# Get our global settings (we only print stuff if it varies from |