]> git.decadent.org.uk Git - dak.git/commitdiff
Merge commit 'buxy/bugfixes' into merge
authorJoerg Jaspert <joerg@debian.org>
Sat, 25 Apr 2009 22:39:22 +0000 (00:39 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sat, 25 Apr 2009 22:39:22 +0000 (00:39 +0200)
* 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 <joerg@debian.org>
1  2 
dak/dakdb/update3.py
dak/dakdb/update5.py

diff --combined dak/dakdb/update3.py
index c91ecf56eadba987c11339109ea371a71cfa65a4,ccd463c4bef3c4866f63ade9f1c9839be0e40a7f..406cc89b3212a59ead022c4037f29663f2f46932
@@@ -1,13 -1,8 +1,13 @@@
  #!/usr/bin/env python
  
 -""" Database Update Script - Remove unused versioncmp """
 -# Copyright (C) 2008  Michael Casadevall <mcasadevall@debian.org>
 -# Copyright (C) 2009  Joerg Jaspert <joerg@debian.org>
 +"""
 +Remove unused versioncmp
 +
 +@contact: Debian FTP Master <ftpmaster@debian.org>
 +@copyright: 2008  Michael Casadevall <mcasadevall@debian.org>
 +@copyright: 2009  Joerg Jaspert <joerg@debian.org>
 +@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 beb961cc3c58d669f0a17f0723e94f758f9897db,c89813e65a2bb8018c9527160e1a2982ae4ff2de..49e338916b92f1a0b4ba9d16912d0059829bde12
@@@ -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 <ftpmaster@debian.org>
  @copyright: 2009  Joerg Jaspert <joerg@debian.org>
@@@ -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