Fix the new glep56 code to handle missing metadata.xml. Thanks to jmbsvicetto
authorZac Medico <zmedico@gentoo.org>
Sun, 27 Jul 2008 23:09:23 +0000 (23:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 27 Jul 2008 23:09:23 +0000 (23:09 -0000)
for reporting.

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

bin/repoman

index 35807c658f7745b5d4726a71a7b6af9b3ec64da1..c45622a00c0016f379ac0c6933b3e460135bf7d8 100755 (executable)
@@ -1061,6 +1061,8 @@ for x in scanlist:
                fails["changelog.missing"].append(x+"/ChangeLog")
        
        #metadata.xml file check
+       muselist = []
+
        if "metadata.xml" not in checkdirlist:
                stats["metadata.missing"]+=1
                fails["metadata.missing"].append(x+"/metadata.xml")
@@ -1080,15 +1082,14 @@ for x in scanlist:
                                stats["metadata.bad"]+=1
                                fails["metadata.bad"].append(x+"/metadata.xml")
 
-       #load USE flags from metadata.xml
-       muselist=[]
-       try:
-               f = open(os.path.join(checkdir, "metadata.xml"))
-               utilities.parse_metadata_use(f, muselist)
-               f.close()
-       except (IOError, OSError, ParseError), e:
-               logging.exception("Couldn't read from metadata.xml", e)
-               sys.exit(1)
+               #load USE flags from metadata.xml
+               try:
+                       f = open(os.path.join(checkdir, "metadata.xml"))
+                       utilities.parse_metadata_use(f, muselist)
+                       f.close()
+               except (EnvironmentError, ParseError), e:
+                       logging.exception("Couldn't read from metadata.xml: %s" % (e,))
+                       sys.exit(1)
 
        allmasked = True