X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=accf5fdb36b9157c4ad1eb5b86dcb1bbce760e2e;hb=7e1fd15629858d8b3437cb7626f853e74c461ec1;hp=b0b71c0169d413e32d5a6c0b1aa009dd76f4211d;hpb=fd9038ac91d1ec43828ae4d0f364952aee2de181;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index b0b71c01..accf5fdb 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -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())