]> git.decadent.org.uk Git - dak.git/commitdiff
Merge branch 'master' of /home/stew/src/dak
authorMike O'Connor <stew@dhcp-101.dfw1.kickstart.lan>
Thu, 29 Oct 2009 16:34:49 +0000 (16:34 +0000)
committerMike O'Connor <stew@dhcp-101.dfw1.kickstart.lan>
Thu, 29 Oct 2009 16:34:49 +0000 (16:34 +0000)
dak/dakdb/update17.py
daklib/config.py
daklib/utils.py

index 0d7efa9efec6c77e325aaa4c885e1766477452d4..b5bbb3cce22bd805cdfc92a39bc1a55caf7438c9 100644 (file)
@@ -52,6 +52,9 @@ def do_update(self):
 
         c.execute("""CREATE INDEX ind_bin_contents_binary ON bin_contents(binary_id);""" )
 
+        c.execute("GRANT ALL ON bin_contents TO ftpmaster;")
+        c.execute("GRANT SELECT ON bin_contents TO public;")
+
         self.db.commit()
 
     except psycopg2.ProgrammingError, msg:
index 09df17bb06be100a2a753793c5416f3750cf3e30..c86c1b36580931bf81427b6f5c0bee48d1acd8df 100755 (executable)
@@ -28,6 +28,7 @@ Config access class
 
 ################################################################################
 
+import os
 import apt_pkg
 import socket
 
@@ -37,10 +38,9 @@ from singleton import Singleton
 
 default_config = "/etc/dak/dak.conf"
 
-def which_conf_file(Cnf):
-    res = socket.gethostbyaddr(socket.gethostname())
-    if Cnf.get("Config::" + res[0] + "::DakConfig"):
-        return Cnf["Config::" + res[0] + "::DakConfig"]
+def which_conf_file():
+    if os.getenv("DAK_CONFIG"):
+        return os.getenv("DAK_CONFIG")
     else:
         return default_config
 
@@ -57,7 +57,7 @@ class Config(Singleton):
 
         self.Cnf = apt_pkg.newConfiguration()
 
-        apt_pkg.ReadConfigFileISC(self.Cnf, default_config)
+        apt_pkg.ReadConfigFileISC(self.Cnf, which_conf_file())
 
         # Check whether our dak.conf was the real one or
         # just a pointer to our main one
index b0b71c0169d413e32d5a6c0b1aa009dd76f4211d..accf5fdb36b9157c4ad1eb5b86dcb1bbce760e2e 100755 (executable)
@@ -710,20 +710,24 @@ def where_am_i ():
         return res[0]
 
 def which_conf_file ():
-    res = socket.gethostbyaddr(socket.gethostname())
-    # In case we allow local config files per user, try if one exists
-    if Cnf.FindB("Config::" + res[0] + "::AllowLocalConfig"):
-        homedir = os.getenv("HOME")
-        confpath = os.path.join(homedir, "/etc/dak.conf")
-        if os.path.exists(confpath):
-            apt_pkg.ReadConfigFileISC(Cnf,default_config)
-
-    # We are still in here, so there is no local config file or we do
-    # not allow local files. Do the normal stuff.
-    if Cnf.get("Config::" + res[0] + "::DakConfig"):
-        return Cnf["Config::" + res[0] + "::DakConfig"]
+    if os.getenv("DAK_CONFIG"):
+        print(os.getenv("DAK_CONFIG"))
+        return os.getenv("DAK_CONFIG")
     else:
-        return default_config
+        res = socket.gethostbyaddr(socket.gethostname())
+        # In case we allow local config files per user, try if one exists
+        if Cnf.FindB("Config::" + res[0] + "::AllowLocalConfig"):
+            homedir = os.getenv("HOME")
+            confpath = os.path.join(homedir, "/etc/dak.conf")
+            if os.path.exists(confpath):
+                apt_pkg.ReadConfigFileISC(Cnf,default_config)
+
+        # We are still in here, so there is no local config file or we do
+        # not allow local files. Do the normal stuff.
+        if Cnf.get("Config::" + res[0] + "::DakConfig"):
+            return Cnf["Config::" + res[0] + "::DakConfig"]
+        else:
+            return default_config
 
 def which_apt_conf_file ():
     res = socket.gethostbyaddr(socket.gethostname())