#!/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
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()
#!/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>
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