From: Joerg Jaspert Date: Sat, 25 Apr 2009 22:39:22 +0000 (+0200) Subject: Merge commit 'buxy/bugfixes' into merge X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=35cd0972b5e14dc8727403e13fccd30776f3ae02;hp=-c;p=dak.git Merge commit 'buxy/bugfixes' into merge * commit 'buxy/bugfixes': dak update-db: fixes to make it work on a fresh install dak init-db: properly initialize suite_architectures Signed-off-by: Joerg Jaspert --- 35cd0972b5e14dc8727403e13fccd30776f3ae02 diff --combined dak/dakdb/update3.py index c91ecf56,ccd463c4..406cc89b --- a/dak/dakdb/update3.py +++ b/dak/dakdb/update3.py @@@ -1,13 -1,8 +1,13 @@@ #!/usr/bin/env python -""" Database Update Script - Remove unused versioncmp """ -# Copyright (C) 2008 Michael Casadevall -# Copyright (C) 2009 Joerg Jaspert +""" +Remove unused versioncmp + +@contact: Debian FTP Master +@copyright: 2008 Michael Casadevall +@copyright: 2009 Joerg Jaspert +@license: GNU General Public License version 2 or later +""" # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@@ -36,7 -31,12 +36,12 @@@ def do_update(self) try: c = self.db.cursor() - c.execute("DROP FUNCTION versioncmp(text, text);") + try: + # This might not exist on a fresh install, so don't fail + # needlessly + c.execute("DROP FUNCTION versioncmp(text, text);") + except: + pass c.execute("UPDATE config SET value = '3' WHERE name = 'db_revision'") self.db.commit() diff --combined dak/dakdb/update5.py index beb961cc,c89813e6..49e33891 --- a/dak/dakdb/update5.py +++ b/dak/dakdb/update5.py @@@ -1,7 -1,7 +1,7 @@@ #!/usr/bin/env python """ -Database Update Script - Fix bin_assoc_by_arch view +Fix bin_assoc_by_arch view @contact: Debian FTP Master @copyright: 2009 Joerg Jaspert @@@ -36,7 -36,6 +36,6 @@@ def do_update(self) print "Fixing bin_assoc_by_arch view" try: c = self.db.cursor() - c.execute("DROP VIEW bin_assoc_by_arch") c.execute("""CREATE OR REPLACE VIEW bin_assoc_by_arch AS SELECT ba.suite, ba.bin, a.id AS arch