1 |
Author: fuzzyray |
2 |
Date: 2009-06-04 23:28:51 +0000 (Thu, 04 Jun 2009) |
3 |
New Revision: 661 |
4 |
|
5 |
Modified: |
6 |
trunk/gentoolkit/pym/gentoolkit/equery/__init__.py |
7 |
trunk/gentoolkit/pym/gentoolkit/equery/belongs.py |
8 |
trunk/gentoolkit/pym/gentoolkit/equery/depends.py |
9 |
trunk/gentoolkit/pym/gentoolkit/equery/meta.py |
10 |
Log: |
11 |
Update with rev 9 from the genscripts repo |
12 |
|
13 |
Modified: trunk/gentoolkit/pym/gentoolkit/equery/__init__.py |
14 |
=================================================================== |
15 |
--- trunk/gentoolkit/pym/gentoolkit/equery/__init__.py 2009-06-04 00:14:38 UTC (rev 660) |
16 |
+++ trunk/gentoolkit/pym/gentoolkit/equery/__init__.py 2009-06-04 23:28:51 UTC (rev 661) |
17 |
@@ -289,8 +289,6 @@ |
18 |
"version": version, |
19 |
"docstring": __doc__ |
20 |
} |
21 |
- print |
22 |
- print __authors__ |
23 |
|
24 |
|
25 |
def split_arguments(args): |
26 |
|
27 |
Modified: trunk/gentoolkit/pym/gentoolkit/equery/belongs.py |
28 |
=================================================================== |
29 |
--- trunk/gentoolkit/pym/gentoolkit/equery/belongs.py 2009-06-04 00:14:38 UTC (rev 660) |
30 |
+++ trunk/gentoolkit/pym/gentoolkit/equery/belongs.py 2009-06-04 23:28:51 UTC (rev 661) |
31 |
@@ -7,7 +7,7 @@ |
32 |
"""List all packages owning a particular file |
33 |
|
34 |
Note: Normally, only one package will own a file. If multiple packages own |
35 |
- the same file, it usually consitutes a problem, and should be reported. |
36 |
+ the same file, it usually constitutes a problem, and should be reported. |
37 |
""" |
38 |
|
39 |
__docformat__ = 'epytext' |
40 |
|
41 |
Modified: trunk/gentoolkit/pym/gentoolkit/equery/depends.py |
42 |
=================================================================== |
43 |
--- trunk/gentoolkit/pym/gentoolkit/equery/depends.py 2009-06-04 00:14:38 UTC (rev 660) |
44 |
+++ trunk/gentoolkit/pym/gentoolkit/equery/depends.py 2009-06-04 23:28:51 UTC (rev 661) |
45 |
@@ -151,7 +151,8 @@ |
46 |
# Find all packages matching the dependency |
47 |
depstr = dependency[0] + dependency[2] |
48 |
if not depstr in DEPPKGS: |
49 |
- depcpvs = find_packages(depstr) |
50 |
+ depcpvs = find_packages(depstr, |
51 |
+ include_masked=QUERY_OPTS["includePortTree"]) |
52 |
DEPPKGS[depstr] = depcpvs |
53 |
else: |
54 |
depcpvs = DEPPKGS[depstr] |
55 |
@@ -240,6 +241,11 @@ |
56 |
if matches: |
57 |
find_dependencies(matches, None) |
58 |
else: |
59 |
- pp.print_error("No matching package found for %s" % query) |
60 |
+ if QUERY_OPTS['includePortTree']: |
61 |
+ pp.print_error("No matching package found for %s" % query) |
62 |
+ else: |
63 |
+ pp.print_error( |
64 |
+ "No matching package or all versions masked for %s" % query |
65 |
+ ) |
66 |
|
67 |
first_run = False |
68 |
|
69 |
Modified: trunk/gentoolkit/pym/gentoolkit/equery/meta.py |
70 |
=================================================================== |
71 |
--- trunk/gentoolkit/pym/gentoolkit/equery/meta.py 2009-06-04 00:14:38 UTC (rev 660) |
72 |
+++ trunk/gentoolkit/pym/gentoolkit/equery/meta.py 2009-06-04 23:28:51 UTC (rev 661) |
73 |
@@ -241,10 +241,38 @@ |
74 |
|
75 |
def get_herd(xml_tree): |
76 |
"""Return a list of text nodes for <herd>.""" |
77 |
+ |
78 |
+ result = [] |
79 |
+ for elem in xml_tree.findall("herd"): |
80 |
+ herd_mail = get_herd_email(elem.text) |
81 |
+ if herd_mail and Config['verbose']: |
82 |
+ result.append("%s (%s)" % (elem.text, herd_mail)) |
83 |
+ else: |
84 |
+ result.append(elem.text) |
85 |
|
86 |
- return [e.text for e in xml_tree.findall("herd")] |
87 |
+ return result |
88 |
|
89 |
|
90 |
+def get_herd_email(herd): |
91 |
+ """Return the email of the given herd if it's in herds.xml, else None.""" |
92 |
+ |
93 |
+ herds_path = os.path.join(PORTDIR[0], "metadata/herds.xml") |
94 |
+ |
95 |
+ try: |
96 |
+ herds_tree = ET.parse(herds_path) |
97 |
+ except IOError, err: |
98 |
+ pp.print_error(str(err)) |
99 |
+ return None |
100 |
+ |
101 |
+ # Some special herds are not listed in herds.xml |
102 |
+ if herd in ('no-herd', 'maintainer-wanted', 'maintainer-needed'): |
103 |
+ return None |
104 |
+ |
105 |
+ for node in herds_tree.getiterator("herd"): |
106 |
+ if node.findtext("name") == herd: |
107 |
+ return node.findtext("email") |
108 |
+ |
109 |
+ |
110 |
def get_description(xml_tree): |
111 |
"""Return a list of text nodes for <longdescription>. |
112 |
|
113 |
@@ -484,7 +512,7 @@ |
114 |
if not package_dir: |
115 |
raise errors.GentoolkitNoMatches(query) |
116 |
metadata_path = os.path.join(package_dir, "metadata.xml") |
117 |
- |
118 |
+ |
119 |
# -------------------------------- |
120 |
# Check options and call functions |
121 |
# -------------------------------- |