* Fix parse_metadata_use() to raise ParseError instead of the ExpatError
authorZac Medico <zmedico@gentoo.org>
Thu, 14 Aug 2008 19:07:22 +0000 (19:07 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 14 Aug 2008 19:07:22 +0000 (19:07 -0000)
  that was reported by grobian.

* Define __all__.

svn path=/main/trunk/; revision=11407

pym/repoman/utilities.py

index b537536bf38aef7625481519adb2d5510daf37fd..10f26727242f4456eb1cb7bab677f819e2f7c30c 100644 (file)
@@ -6,6 +6,18 @@
 """This module contains utility functions to help repoman find ebuilds to
 scan"""
 
+__all__ = [
+       "detect_vcs_conflicts",
+       "editor_is_executable",
+       "FindPackagesToScan",
+       "FindPortdir",
+       "format_qa_output",
+       "get_commit_message_with_editor",
+       "get_commit_message_with_stdin",
+       "have_profile_dir",
+       "parse_metadata_use"
+]
+
 import commands
 import errno
 import itertools
@@ -15,6 +27,7 @@ import sys
 
 from xml.dom import minidom
 from xml.dom import NotFoundErr
+from xml.parsers.expat import ExpatError
 from portage import output
 from portage.output import red, green
 from portage.process import find_binary
@@ -97,7 +110,10 @@ def parse_metadata_use(mylines, uselist=None):
        returns a dict of the form a list of flags"""
        if uselist is None:
                uselist = []
-       metadatadom = minidom.parse(mylines)
+       try:
+               metadatadom = minidom.parse(mylines)
+       except ExpatError, e:
+               raise exception.ParseError("metadata.xml: %s" % (e,))
 
        try:
                usetag = metadatadom.getElementsByTagName("use")