]> git.decadent.org.uk Git - dak.git/commitdiff
Merge remote branch 'mhy/master' into merge
authorMark Hymers <mhy@debian.org>
Wed, 23 Mar 2011 14:37:09 +0000 (14:37 +0000)
committerMark Hymers <mhy@debian.org>
Wed, 23 Mar 2011 14:37:09 +0000 (14:37 +0000)
Signed-off-by: Mark Hymers <mhy@debian.org>
1  2 
dak/update_db.py

diff --combined dak/update_db.py
index dadaf3517951b8d469677d2557c5a078129e7d6b,b58996b1e019b727dc010c27922038b17c22dd11..3effa47741362500138fd6a18df0b8821837b362
@@@ -46,7 -46,7 +46,7 @@@ from daklib.daklog import Logge
  ################################################################################
  
  Cnf = None
 -required_database_schema = 47
 +required_database_schema = 48
  
  ################################################################################
  
@@@ -123,9 -123,12 +123,12 @@@ Updates dak's database schema to the la
  
          try:
              # Build a connect string
-             connect_str = "dbname=%s"% (cnf["DB::Name"])
-             if cnf["DB::Host"] != '': connect_str += " host=%s" % (cnf["DB::Host"])
-             if cnf["DB::Port"] != '-1': connect_str += " port=%d" % (int(cnf["DB::Port"]))
+             if cnf["DB::Service"]:
+                 connect_str = "service=%s" % cnf["DB::Service"]
+             else:
+                 connect_str = "dbname=%s"% (cnf["DB::Name"])
+                 if cnf["DB::Host"] != '': connect_str += " host=%s" % (cnf["DB::Host"])
+                 if cnf["DB::Port"] != '-1': connect_str += " port=%d" % (int(cnf["DB::Port"]))
  
              self.db = psycopg2.connect(connect_str)