From: fuzzyray Date: Thu, 4 Jun 2009 23:28:51 +0000 (-0000) Subject: Update with rev 9 from the genscripts repo X-Git-Tag: gentoolkit-0.3.0_rc7~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=34dbc0619888d96aa9029ee71e6da95ed586478b;p=gentoolkit.git Update with rev 9 from the genscripts repo svn path=/trunk/gentoolkit/; revision=661 --- diff --git a/pym/gentoolkit/equery/__init__.py b/pym/gentoolkit/equery/__init__.py index 8764e1c..c205938 100644 --- a/pym/gentoolkit/equery/__init__.py +++ b/pym/gentoolkit/equery/__init__.py @@ -289,8 +289,6 @@ def print_version(): "version": version, "docstring": __doc__ } - print - print __authors__ def split_arguments(args): diff --git a/pym/gentoolkit/equery/belongs.py b/pym/gentoolkit/equery/belongs.py index 215fbd1..d4da36f 100644 --- a/pym/gentoolkit/equery/belongs.py +++ b/pym/gentoolkit/equery/belongs.py @@ -7,7 +7,7 @@ """List all packages owning a particular file Note: Normally, only one package will own a file. If multiple packages own - the same file, it usually consitutes a problem, and should be reported. + the same file, it usually constitutes a problem, and should be reported. """ __docformat__ = 'epytext' diff --git a/pym/gentoolkit/equery/depends.py b/pym/gentoolkit/equery/depends.py index 6377f2c..a1a0d20 100644 --- a/pym/gentoolkit/equery/depends.py +++ b/pym/gentoolkit/equery/depends.py @@ -151,7 +151,8 @@ def find_dependencies(matches, pkg_cache): # Find all packages matching the dependency depstr = dependency[0] + dependency[2] if not depstr in DEPPKGS: - depcpvs = find_packages(depstr) + depcpvs = find_packages(depstr, + include_masked=QUERY_OPTS["includePortTree"]) DEPPKGS[depstr] = depcpvs else: depcpvs = DEPPKGS[depstr] @@ -240,6 +241,11 @@ def main(input_args): if matches: find_dependencies(matches, None) else: - pp.print_error("No matching package found for %s" % query) + if QUERY_OPTS['includePortTree']: + pp.print_error("No matching package found for %s" % query) + else: + pp.print_error( + "No matching package or all versions masked for %s" % query + ) first_run = False diff --git a/pym/gentoolkit/equery/meta.py b/pym/gentoolkit/equery/meta.py index a531537..d847f56 100644 --- a/pym/gentoolkit/equery/meta.py +++ b/pym/gentoolkit/equery/meta.py @@ -241,8 +241,36 @@ def format_list(lst, first="", subsequent="", force_quiet=False): def get_herd(xml_tree): """Return a list of text nodes for .""" + + result = [] + for elem in xml_tree.findall("herd"): + herd_mail = get_herd_email(elem.text) + if herd_mail and Config['verbose']: + result.append("%s (%s)" % (elem.text, herd_mail)) + else: + result.append(elem.text) + + return result + - return [e.text for e in xml_tree.findall("herd")] +def get_herd_email(herd): + """Return the email of the given herd if it's in herds.xml, else None.""" + + herds_path = os.path.join(PORTDIR[0], "metadata/herds.xml") + + try: + herds_tree = ET.parse(herds_path) + except IOError, err: + pp.print_error(str(err)) + return None + + # Some special herds are not listed in herds.xml + if herd in ('no-herd', 'maintainer-wanted', 'maintainer-needed'): + return None + + for node in herds_tree.getiterator("herd"): + if node.findtext("name") == herd: + return node.findtext("email") def get_description(xml_tree): @@ -484,7 +512,7 @@ def main(input_args): if not package_dir: raise errors.GentoolkitNoMatches(query) metadata_path = os.path.join(package_dir, "metadata.xml") - + # -------------------------------- # Check options and call functions # --------------------------------