]> git.decadent.org.uk Git - dak.git/commitdiff
Merge commit 'allan/bugfixes' into merge
authorJoerg Jaspert <joerg@debian.org>
Mon, 4 May 2009 19:19:37 +0000 (21:19 +0200)
committerJoerg Jaspert <joerg@debian.org>
Mon, 4 May 2009 19:19:37 +0000 (21:19 +0200)
* commit 'allan/bugfixes':
  Check for the existance of the function before trying to drop it.
  Added mention of groups required by update11.py
  Fixed missing DBUpdateError imports.

Signed-off-by: Joerg Jaspert <joerg@debian.org>
dak/dakdb/update11.py
dak/dakdb/update12.py
dak/dakdb/update3.py
dak/dakdb/update6.py
docs/README.first

index 53f1572a2c0b89bb3f8d19183eeae41b1eb8cdd7..a4797cb4bdf557e1634304403a9d6ffffd855e8d 100755 (executable)
@@ -30,6 +30,7 @@ Adding process-new comments to the DB
 
 import psycopg2
 import time
+from daklib.dak_exceptions import DBUpdateError
 
 ################################################################################
 
index 70a9e18e41df11ef751afeb523b61cbc97438c9f..890f51cb66c75a767693cec4762450b5ae394d55 100755 (executable)
@@ -30,6 +30,7 @@ Adding a date field to the process-new notes
 
 import psycopg2
 import time
+from daklib.dak_exceptions import DBUpdateError
 
 ################################################################################
 
index 406cc89b3212a59ead022c4037f29663f2f46932..5a5562fbedfe2659c5c2990f7ba125b3a25ac00c 100755 (executable)
@@ -36,12 +36,15 @@ def do_update(self):
 
     try:
         c = self.db.cursor()
-        try:
-            # This might not exist on a fresh install, so don't fail
-            # needlessly
+        # The reason we try and check to see if it exists is that
+        # psycopg2 might leave the cursor invalid if the drop fails
+        c.execute("SELECT proname from pg_catalog.pg_proc WHERE proname = 'versioncmp'")
+        rows = c.fetchall()
+        if rows:
             c.execute("DROP FUNCTION versioncmp(text, text);")
-        except:
-            pass
+        else:
+            print "function already does not exist"
+
         c.execute("UPDATE config SET value = '3' WHERE name = 'db_revision'")
 
         self.db.commit()
index c7b0b17f33db01cd81dfb29a41062022ca85a0a4..13d609669f03d3b0905827cd7174a06e0d836300 100755 (executable)
@@ -33,6 +33,7 @@ Adding content fields
 
 import psycopg2
 import time
+from daklib.dak_exceptions import DBUpdateError
 
 ################################################################################
 
index 237d63cf6b54f0929a5c86bacab1556a31591c8e..c1eb3d36e56b9e12dfba4e4763719f90a5f4bcbe 100644 (file)
@@ -114,11 +114,11 @@ o If you have an existing archive:
      which are needed for this.  After changing all occurences of "projectb"
      to the name of your database (as defined in DB::Name) you can run:
          psql <DB::Name> < init_pool.sql
+   * Create the following groups in postgres: ftpmaster ftpteam ftptrainee
    * Run 'dak update-db' to upgrade the database schema.
    * Run 'dak init-db': it will populate your database with the values from
      dak.conf and apt.conf.
    * Run 'psql <DB::Name> < add_constraints.sql'.
 o Copy all templates from the "templates" directory to to the directory
   specified in Dir::Templates, and adapt them to your distribution.
-o Create an 'ftpmaster' group in postgres.