X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fchanges.py;h=1214b03bffb06e9843dcdcc2cdf64b893ba35448;hb=554c9c0777c3444720c8d6064608cff5f89f62c0;hp=54adb3b06b4d091a0134df5eff7820daee2ba466;hpb=8f5b3839b085130dd5fc89b96d54592c8adbdbdc;p=dak.git diff --git a/daklib/changes.py b/daklib/changes.py index 54adb3b0..1214b03b 100644 --- a/daklib/changes.py +++ b/daklib/changes.py @@ -187,11 +187,16 @@ class Changes(object): if (not self.changes.has_key(key)) or (not self.changes[key]): self.changes[key]='missing' - def __get_file_from_pool(self, filename, entry, session): + def __get_file_from_pool(self, filename, entry, session, logger): cnf = Config() - poolname = poolify(entry["source"], entry["component"]) - l = get_location(cnf["Dir::Pool"], entry["component"], session=session) + if cnf.has_key("Dinstall::SuiteSuffix"): + component = cnf["Dinstall::SuiteSuffix"] + entry["component"] + else: + component = entry["component"] + + poolname = poolify(entry["source"], component) + l = get_location(cnf["Dir::Pool"], component, session=session) found, poolfile = check_poolfile(os.path.join(poolname, filename), entry['size'], @@ -200,20 +205,23 @@ class Changes(object): session=session) if found is None: - Logger.log(["E: Found multiple files for pool (%s) for %s" % (chg_fn, entry["component"])]) + if logger is not None: + logger.log(["E: Found multiple files for pool (%s) for %s" % (filename, component)]) return None elif found is False and poolfile is not None: - Logger.log(["E: md5sum/size mismatch for %s in pool" % (chg_fn)]) + if logger is not None: + logger.log(["E: md5sum/size mismatch for %s in pool" % (filename)]) return None else: if poolfile is None: - Logger.log(["E: Could not find %s in pool" % (chg_fn)]) + if logger is not None: + logger.log(["E: Could not find %s in pool" % (filename)]) return None else: return poolfile @session_wrapper - def add_known_changes(self, dirpath, in_queue=None, session=None): + def add_known_changes(self, dirpath, in_queue=None, session=None, logger=None): """add "missing" in fields which we will require for the known_changes table""" cnf = Config() @@ -285,7 +293,7 @@ class Changes(object): continue entry['source'] = self.changes['source'] - poolfile = self.__get_file_from_pool(name, entry, session) + poolfile = self.__get_file_from_pool(name, entry, session, logger) if poolfile: chg.poolfiles.append(poolfile)