]> git.decadent.org.uk Git - dak.git/blobdiff - dak/dakdb/update18.py
And now this is clearly pythons fault. Ruby would have broken earlier! :)
[dak.git] / dak / dakdb / update18.py
index 3bf1fbf8723cf9922460e8638c81f7c5ad3809c1..c462b16af0e68fe53aec89d76824acb9daffd8dc 100755 (executable)
@@ -34,6 +34,7 @@ import os
 import datetime
 from daklib.dak_exceptions import DBUpdateError, InvalidDscError, ChangesUnicodeError
 from daklib.config import Config
+from daklib.changes import Changes
 from daklib.utils import parse_changes, warn, gpgv_get_status_output, process_gpgv_output
 
 ################################################################################
@@ -127,23 +128,23 @@ def do_update(self):
                 print "Looking into %s" % (checkdir)
                 for filename in os.listdir(checkdir):
                     if not filename.endswith(".changes"):
-                            # Only interested in changes files.
-                            continue
-                        try:
-                            count += 1
-                            print "Directory %s, file %7d, failures %3d. (%s)" % (directory, count, failure, filename)
-                            changes = Changes()
-                            changes.changes_file = filename
-                            changesfile = os.path.join(checkdir, filename)
-                            changes.changes = parse_changes(changesfile, signing_rules=-1)
-                            changes.changes["fingerprint"], = check_signature(changesfile)
-                            changes.add_known_changes(directory)
-                        except InvalidDscError, line:
-                            warn("syntax error in .dsc file '%s', line %s." % (f, line))
-                            failure += 1
-                        except ChangesUnicodeError:
-                            warn("found invalid changes file, not properly utf-8 encoded")
-                            failure += 1
+                        # Only interested in changes files.
+                        continue
+                    try:
+                        count += 1
+                        print "Directory %s, file %7d, failures %3d. (%s)" % (directory, count, failure, filename)
+                        changes = Changes()
+                        changes.changes_file = filename
+                        changesfile = os.path.join(checkdir, filename)
+                        changes.changes = parse_changes(changesfile, signing_rules=-1)
+                        changes.changes["fingerprint"] = check_signature(changesfile)
+                        changes.add_known_changes(directory)
+                    except InvalidDscError, line:
+                        warn("syntax error in .dsc file '%s', line %s." % (f, line))
+                        failure += 1
+                    except ChangesUnicodeError:
+                        warn("found invalid changes file, not properly utf-8 encoded")
+                        failure += 1
 
 
         c.execute("GRANT ALL ON known_changes TO ftpmaster;")
@@ -154,4 +155,4 @@ def do_update(self):
 
     except psycopg2.ProgrammingError, msg:
         self.db.rollback()
-        raise DBUpdateError, "Unable to apply known_changes update 18, rollback issued. Error message
+        raise DBUpdateError, "Unable to apply knownchanges update 18, rollback issued. Error message : %s" % (str(msg))