From: Joerg Jaspert Date: Sat, 27 Feb 2010 09:07:27 +0000 (+0100) Subject: Merge remote branch 'mario/master' into merge X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=ce828cf5a3557613771eab8f0ad59586bbbcecbb;hp=f1b378ae2fa431750b641bacad2cac26a0411e53;p=dak.git Merge remote branch 'mario/master' into merge * mario/master: init_db.py: fix for `do_priority' init_db.py: `Cnf.get' fix for `do_priority' init_db.py: fixes for `do_suite' init_db.py: typo fix for `do_suite' comment. admin.py: added command to add suites Signed-off-by: Joerg Jaspert --- diff --git a/dak/show_new.py b/dak/show_new.py index bcf1300e..5c7e8864 100755 --- a/dak/show_new.py +++ b/dak/show_new.py @@ -177,15 +177,13 @@ def do_pkg(changes_file, session): filestoexamine = [] for pkg in new.keys(): for fn in new[pkg]["files"]: - if (files[fn].has_key("new") and - (files[fn]["type"] == "dsc" or - not re_source_ext.match(files[fn]["type"]))): - filestoexamine.append(fn) + filestoexamine.append(fn) html_header(changes["source"], filestoexamine) check_valid(new) - examine_package.display_changes( u.pkg.changes["distribution"], changes_file) + distribution = changes["distribution"].keys()[0] + examine_package.display_changes(distribution, changes_file) for fn in filter(lambda fn: fn.endswith(".dsc"), filestoexamine): examine_package.check_dsc(distribution, fn) diff --git a/daklib/utils.py b/daklib/utils.py index b1a34c92..0896d578 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -730,20 +730,20 @@ def copy (src, dest, overwrite = 0, perms = 0664): ################################################################################ def where_am_i (): - res = socket.gethostbyaddr(socket.gethostname()) - database_hostname = Cnf.get("Config::" + res[0] + "::DatabaseHostname") + res = socket.getfqdn() + database_hostname = Cnf.get("Config::" + res + "::DatabaseHostname") if database_hostname: return database_hostname else: - return res[0] + return res def which_conf_file (): if os.getenv('DAK_CONFIG'): return os.getenv('DAK_CONFIG') - res = socket.gethostbyaddr(socket.gethostname()) + res = socket.getfqdn() # In case we allow local config files per user, try if one exists - if Cnf.FindB("Config::" + res[0] + "::AllowLocalConfig"): + if Cnf.FindB("Config::" + res + "::AllowLocalConfig"): homedir = os.getenv("HOME") confpath = os.path.join(homedir, "/etc/dak.conf") if os.path.exists(confpath): @@ -751,27 +751,27 @@ def which_conf_file (): # 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 Cnf.get("Config::" + res + "::DakConfig"): + return Cnf["Config::" + res + "::DakConfig"] return default_config def which_apt_conf_file (): - res = socket.gethostbyaddr(socket.gethostname()) + res = socket.getfqdn() # In case we allow local config files per user, try if one exists - if Cnf.FindB("Config::" + res[0] + "::AllowLocalConfig"): + if Cnf.FindB("Config::" + res + "::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"] + if Cnf.get("Config::" + res + "::AptConfig"): + return Cnf["Config::" + res + "::AptConfig"] else: return default_apt_config def which_alias_file(): - hostname = socket.gethostbyaddr(socket.gethostname())[0] + hostname = socket.getfqdn() aliasfn = '/var/lib/misc/'+hostname+'/forward-alias' if os.path.exists(aliasfn): return aliasfn