X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate16.py;h=6cd6dc4b1b7af19566cc26901e77588f6402a288;hb=61d1e2b14d61c045dcc07cd177dec49af0c41c45;hp=e5b86994e99e45f1e512ae475a97d8e4b6b50c54;hpb=b10c8f22028028dfe86d6d8a83b030b08464322e;p=dak.git diff --git a/dak/dakdb/update16.py b/dak/dakdb/update16.py old mode 100755 new mode 100644 index e5b86994..6cd6dc4b --- a/dak/dakdb/update16.py +++ b/dak/dakdb/update16.py @@ -131,6 +131,10 @@ def do_update(self): c.execute("ALTER TABLE keyrings ADD COLUMN default_source_acl_id INT4 REFERENCES source_acl (id) DEFAULT NULL") c.execute("ALTER TABLE keyrings ADD COLUMN default_binary_acl_id INT4 REFERENCES binary_acl (id) DEFAULT NULL") c.execute("ALTER TABLE keyrings ADD COLUMN default_binary_reject BOOLEAN NOT NULL DEFAULT TRUE") + # Set up keyring priorities + c.execute("ALTER TABLE keyrings ADD COLUMN priority INT4 NOT NULL DEFAULT 100") + # And then we don't need the DM stuff any more + c.execute("ALTER TABLE keyrings DROP COLUMN debian_maintainer") # Default ACLs for keyrings c.execute(""" @@ -156,6 +160,7 @@ def do_update(self): default_binary_acl_id = (SELECT id FROM binary_acl WHERE access_level = 'full') WHERE name = 'debian-maintainers.gpg'""") + c.execute("""UPDATE keyrings SET priority = 90 WHERE name = 'debian-maintainers.gpg'""") # Initialize the existing keys c.execute("""UPDATE fingerprint SET binary_acl_id = (SELECT default_binary_acl_id FROM keyrings @@ -168,6 +173,6 @@ def do_update(self): c.execute("UPDATE config SET value = '16' WHERE name = 'db_revision'") self.db.commit() - except psycopg2.ProgrammingError, msg: + except psycopg2.ProgrammingError as msg: self.db.rollback() - raise DBUpdateError, "Unable to apply ACLs update (16), rollback issued. Error message : %s" % (str(msg)) + raise DBUpdateError("Unable to apply ACLs update (16), rollback issued. Error message : %s" % (str(msg)))