X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=f2a790414e1b5028534f06acd851c4823bedc907;hb=cef9cea84f51cacb08d6096abe770527eba6865d;hp=655e3817f0aa2fba2bc8cb370cdcdcd1e8df745d;hpb=2b27c94e1c4d59f54fbec176a91631c09cea4988;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 655e3817..f2a79041 100644 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -42,6 +42,7 @@ import re import email as modemail import subprocess import ldap +import errno import daklib.config as config import daklib.daksubprocess @@ -358,7 +359,7 @@ def check_size(where, files): try: entry = os.stat(f) except OSError as exc: - if exc.errno == 2: + if exc.errno == errno.ENOENT: # TODO: This happens when the file is in the pool. continue raise @@ -762,14 +763,6 @@ def copy (src, dest, overwrite = 0, perms = 0o664): ################################################################################ -def where_am_i (): - res = socket.getfqdn() - database_hostname = Cnf.get("Config::" + res + "::DatabaseHostname") - if database_hostname: - return database_hostname - else: - return res - def which_conf_file (): if os.getenv('DAK_CONFIG'): return os.getenv('DAK_CONFIG') @@ -789,14 +782,6 @@ def which_conf_file (): return default_config -def which_alias_file(): - hostname = socket.getfqdn() - aliasfn = '/var/lib/misc/'+hostname+'/forward-alias' - if os.path.exists(aliasfn): - return aliasfn - else: - return None - ################################################################################ def TemplateSubst(subst_map, filename): @@ -1850,9 +1835,10 @@ def check_reverse_depends(removals, suite, arches=None, session=None, cruft=Fals .filter(Override.package == re.sub('/(contrib|non-free)$', '', source)) \ .join(Override.overridetype).filter(OverrideType.overridetype == 'dsc') \ .first() + key = source if component != "main": - source = "%s/%s" % (source, component) - all_broken.setdefault(source, set()).add(pp_deps(dep)) + key = "%s/%s" % (source, component) + all_broken.setdefault(key, set()).add(pp_deps(dep)) dep_problem = 1 if all_broken: