]> git.decadent.org.uk Git - dak.git/commitdiff
Check that we can parse the YAML file before we symlink anything.
authorChris Lamb <lamby@debian.org>
Thu, 29 Oct 2009 13:43:37 +0000 (13:43 +0000)
committerChris Lamb <lamby@debian.org>
Thu, 29 Oct 2009 13:43:37 +0000 (13:43 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
daklib/queue.py

index 8ab693a86e89bbe72c30916ace7916687c01ca75..61e2df05d5bef723b0b7b713b0f9a56d65599c95 100755 (executable)
@@ -1214,6 +1214,16 @@ class Upload(object):
             # We don't have a tagfile, so just don't do anything.
             return
 
+        # Parse the yaml file
+        sourcefile = file(tagfile, 'r')
+        sourcecontent = sourcefile.read()
+        sourcefile.close()
+        try:
+            lintiantags = yaml.load(sourcecontent)['lintian']
+        except yaml.YAMLError, msg:
+            utils.fubar("Can not read the lintian tags file %s, YAML error: %s." % (tagfile, msg))
+            return
+
         # Try and find all orig mentioned in the .dsc
         target_dir = '.'
         symlinked = []
@@ -1281,16 +1291,6 @@ class Upload(object):
                 if symlink_if_valid(queuefile_path):
                     break
 
-        # Parse the yaml file
-        sourcefile = file(tagfile, 'r')
-        sourcecontent = sourcefile.read()
-        sourcefile.close()
-        try:
-            lintiantags = yaml.load(sourcecontent)['lintian']
-        except yaml.YAMLError, msg:
-            utils.fubar("Can not read the lintian tags file %s, YAML error: %s." % (tagfile, msg))
-            return
-
         # Now setup the input file for lintian. lintian wants "one tag per line" only,
         # so put it together like it. We put all types of tags in one file and then sort
         # through lintians output later to see if its a fatal tag we detected, or not.