Update with rev 9 from the genscripts repo
authorfuzzyray <fuzzyray@gentoo.org>
Thu, 4 Jun 2009 23:28:51 +0000 (23:28 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Thu, 4 Jun 2009 23:28:51 +0000 (23:28 -0000)
svn path=/trunk/gentoolkit/; revision=661

pym/gentoolkit/equery/__init__.py
pym/gentoolkit/equery/belongs.py
pym/gentoolkit/equery/depends.py
pym/gentoolkit/equery/meta.py

index 8764e1c11a51281c8168927b8bdf62e704999fad..c2059384a22879515015b98185b672442d0fbdaa 100644 (file)
@@ -289,8 +289,6 @@ def print_version():
                "version": version,
                "docstring": __doc__
        }
-       print
-       print __authors__
 
 
 def split_arguments(args):
index 215fbd1e8fecab8e3440866cac2eeaf9c19c3200..d4da36fbd52d22c8a9fef70e9b554883dd5d08ed 100644 (file)
@@ -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'
index 6377f2c18fd9138d7ac4ada60f989e522b3d3a41..a1a0d20e8b5d798fdc3a095451cc43805255f698 100644 (file)
@@ -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
index a531537c0bc64acf421ddec2abd5456539d50e25..d847f563f1c0f9180a12c8ccb4667ab8d4f24d96 100644 (file)
@@ -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 <herd>."""
+       
+       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
                        # --------------------------------