X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=c40fe8e0efafcde03c217151f647c1a1672e3f97;hb=87bf163d12ec8328d87e1b2a2ca2239221a73bd6;hp=6135a19f6f8bdf303d4978f7ce06868f9eef9c4a;hpb=cfd5cb30c2302d4f16ffef06f56f932ea570adac;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 6135a19f..c40fe8e0 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -260,6 +260,7 @@ def create_hash(where, files, hashname, hashfunc): file_handle = open_file(f) except CantOpenError: rejmsg.append("Could not open file %s for checksumming" % (f)) + continue files[f][hash_key(hashname)] = hashfunc(file_handle) @@ -744,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): + 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: @@ -751,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: @@ -1494,7 +1511,7 @@ def temp_dirname(parent=None, prefix="dak", suffix=""): Returns a pathname to the new directory """ - return tempfile.mkdtemp(suffix, prefix, directory) + return tempfile.mkdtemp(suffix, prefix, parent) ################################################################################