From: Raphael Hertzog Date: Tue, 7 Apr 2009 06:52:12 +0000 (+0200) Subject: Merge branch 'master' into bugfixes X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=425e44739cd77ffa01294f23e94ae7eabd5f5ec8;hp=459c6eaf4425915f363530216cd239fe9d8d0f9d;p=dak.git Merge branch 'master' into bugfixes Conflicts: dak/init_db.py --- diff --git a/dak/dakdb/update3.py b/dak/dakdb/update3.py index eef7d4c6..ccd463c4 100755 --- a/dak/dakdb/update3.py +++ b/dak/dakdb/update3.py @@ -31,7 +31,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 --git a/dak/dakdb/update5.py b/dak/dakdb/update5.py index 1d820de4..c89813e6 100755 --- a/dak/dakdb/update5.py +++ b/dak/dakdb/update5.py @@ -36,7 +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 diff --git a/dak/init_db.py b/dak/init_db.py index 31a2a5a7..e15d7680 100755 --- a/dak/init_db.py +++ b/dak/init_db.py @@ -139,7 +139,7 @@ class InitDB(object): origin = sql_get(suite_config, "Origin") description = sql_get(suite_config, "Description") c.execute(suite_add, [suite.lower(), version, origin, description]) - for architecture in self.Cnf.ValueList("Suite::%s::Architectures" % (suite)): + for architecture in self.Cnf.SubTree("Architectures").List(): architecture_id = self.projectB.get_architecture_id (architecture) if architecture_id < 0: utils.fubar("architecture '%s' not found in architecture" diff --git a/docs/README.first b/docs/README.first index 9b7aa9cb..237d63cf 100644 --- a/docs/README.first +++ b/docs/README.first @@ -114,6 +114,7 @@ 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 < init_pool.sql + * 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 < add_constraints.sql'.