From ad21c975269100ed4f1f31d968410f5a1375b268 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sun, 19 Apr 2009 18:37:46 +0200 Subject: [PATCH] which_conf_file if local config files are allowed, return the path for them, in case one exists. if not just behave as usual. Signed-off-by: Joerg Jaspert --- daklib/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/daklib/utils.py b/daklib/utils.py index 651e13ae..cb7efbea 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -745,6 +745,15 @@ def where_am_i (): 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): + return confpath + + # 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: -- 2.39.5