]> git.decadent.org.uk Git - dak.git/commitdiff
Merge remote branch 'bdefreese/barry_update25' into merge
authorJoerg Jaspert <joerg@debian.org>
Tue, 24 Nov 2009 22:17:30 +0000 (23:17 +0100)
committerJoerg Jaspert <joerg@debian.org>
Tue, 24 Nov 2009 22:17:30 +0000 (23:17 +0100)
* bdefreese/barry_update25:
  Update update_db to use schema 26
  Fix indentation on commit to be outside for loop but inside try. Add update to db_revision to set it to 26.
  Add dakdb/update26.py to add created and modified fields on all tables and add a trigger to update the modified field on update

Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/dakdb/update26.py
dak/override.py
dak/process_new.py

index 3c7b0825f3bb77b8d7e789220966a8133a62e590..1b9a7fc14b11089addf6f5171b7dcde140ddaf38 100755 (executable)
@@ -29,18 +29,18 @@ def do_update(self):
 
     updatetables = ['architecture', 'archive', 'bin_associations', 'bin_contents',
         'binaries', 'binary_acl', 'binary_acl_map', 'build_queue', 'build_queue_files',
-        'changes', 'changes_pending_binaries', 'changes_pending_files', 
-        'changes_pending_files_map', 'changes_pending_source', 'changes_pending_source_files', 
-        'changes_pool_files', 'component', 'config', 'dsc_files', 'files', 'fingerprint', 
-        'keyring_acl_map', 'keyrings', 'location', 'maintainer', 'new_comments', 'override', 
-        'override_type', 'policy_queue', 'priority', 'section', 'source', 'source_acl', 
-        'src_associations', 'src_format', 'src_uploaders', 'suite', 'suite_architectures', 
+        'changes', 'changes_pending_binaries', 'changes_pending_files',
+        'changes_pending_files_map', 'changes_pending_source', 'changes_pending_source_files',
+        'changes_pool_files', 'component', 'config', 'dsc_files', 'files', 'fingerprint',
+        'keyring_acl_map', 'keyrings', 'location', 'maintainer', 'new_comments', 'override',
+        'override_type', 'policy_queue', 'priority', 'section', 'source', 'source_acl',
+        'src_associations', 'src_format', 'src_uploaders', 'suite', 'suite_architectures',
         'suite_build_queue_copy', 'suite_src_formats', 'uid', 'upload_blocks']
 
     c = self.db.cursor()
 
     print "Create trigger function."
-    c.execute("""CREATE OR REPLACE FUNCTION tfunc_set_modified() RETURNS trigger AS $$ 
+    c.execute("""CREATE OR REPLACE FUNCTION tfunc_set_modified() RETURNS trigger AS $$
     BEGIN NEW.modified = now(); return NEW; END;
     $$ LANGUAGE 'plpgsql'""")
 
@@ -54,9 +54,9 @@ def do_update(self):
             c.execute("ALTER TABLE %s ADD COLUMN modified TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()" % updatetable)
 
             print "Create modified trigger."
-            c.execute("""CREATE TRIGGER modified_%s BEFORE UPDATE ON %s 
+            c.execute("""CREATE TRIGGER modified_%s BEFORE UPDATE ON %s
             FOR EACH ROW EXECUTE PROCEDURE tfunc_set_modified()""" % (updatetable, updatetable))
-       
+
         print "Committing"
         c.execute("UPDATE config SET value = '26' WHERE name = 'db_revision'")
         self.db.commit()
index e253967749c948a3d20fe2c6e28053ecad12a7dd..ce35d925ff978fca8bcb11ff06942c06a9e5ed19 100755 (executable)
@@ -240,9 +240,9 @@ def main ():
             Subst["__BCC__"] = "Bcc: " + ", ".join(bcc)
         else:
             Subst["__BCC__"] = "X-Filler: 42"
-        Subst["__CC__"] = "Cc: " + package + "@" + Cnf["Dinstall::PackagesServer"] + "\nX-DAK: dak override"
-        Subst["__ADMIN_ADDRESS__"] = Cnf["Dinstall::MyAdminAddress"]
-        Subst["__DISTRO__"] = Cnf["Dinstall::MyDistribution"]
+        Subst["__CC__"] = "Cc: " + package + "@" + cnf["Dinstall::PackagesServer"] + "\nX-DAK: dak override"
+        Subst["__ADMIN_ADDRESS__"] = cnf["Dinstall::MyAdminAddress"]
+        Subst["__DISTRO__"] = cnf["Dinstall::MyDistribution"]
         Subst["__WHOAMI__"] = utils.whoami()
         Subst["__SOURCE__"] = package
 
index 9f7694d805464a13913030ceb4f36432b3dd3c64..6bdd301f23512345c0b485f3c2241302ed3a0a1c 100755 (executable)
@@ -675,11 +675,11 @@ def do_new(upload, session):
         elif answer == 'E' and not Options["Trainee"]:
             new = edit_overrides (new, upload, session)
         elif answer == 'M' and not Options["Trainee"]:
-            upload.pkg.remove_known_changes()
             aborted = upload.do_reject(manual=1,
                                        reject_message=Options["Manual-Reject"],
                                        note=get_new_comments(changes.get("source", ""), session=session))
             if not aborted:
+                upload.pkg.remove_known_changes()
                 Logger.log(["NEW REJECT: %s" % (upload.pkg.changes_file)])
                 done = 1
         elif answer == 'N':