]> git.decadent.org.uk Git - dak.git/commitdiff
which_apt_conf_file
authorJoerg Jaspert <joerg@debian.org>
Sun, 19 Apr 2009 16:45:29 +0000 (18:45 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sun, 19 Apr 2009 16:45:29 +0000 (18:45 +0200)
do the same for the apt.conf files

Signed-off-by: Joerg Jaspert <joerg@debian.org>
daklib/utils.py

index 01ed2ede03e0ef281a2261813c0a2c943732d4d2..c40fe8e0efafcde03c217151f647c1a1672e3f97 100755 (executable)
@@ -761,6 +761,13 @@ def which_conf_file ():
 
 def which_apt_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)
+
     if Cnf.get("Config::" + res[0] + "::AptConfig"):
         return Cnf["Config::" + res[0] + "::AptConfig"]
     else: