From: Cameron Dale Date: Tue, 8 Jan 2008 20:38:18 +0000 (-0800) Subject: Add back the updatedFile method to the MirrorManager. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b81ab657e1565ae71fb76a74dad79d79f1bb3fa9;p=quix0rs-apt-p2p.git Add back the updatedFile method to the MirrorManager. --- diff --git a/apt_dht/MirrorManager.py b/apt_dht/MirrorManager.py index cc21d9f..c89a591 100644 --- a/apt_dht/MirrorManager.py +++ b/apt_dht/MirrorManager.py @@ -187,6 +187,11 @@ class MirrorManager: site_cache = os.path.join(self.cache_dir, aptpkg_dir, 'mirrors', site + baseDir.replace('/', '_')) self.apt_caches[site][baseDir] = AptPackages(site_cache) + def updatedFile(self, url, file_path): + site, baseDir, path = self.extractPath(url) + self.init(site, baseDir) + self.apt_caches[site][baseDir].file_updated(path, file_path) + def findHash(self, url): site, baseDir, path = self.extractPath(url) if site in self.apt_caches and baseDir in self.apt_caches[site]: @@ -244,11 +249,9 @@ class MirrorManager: if ext: os.utime(decFile.path, (modtime, modtime)) - site, baseDir, path = self.extractPath(url) - self.init(site, baseDir) - self.apt_caches[site][baseDir].file_updated(path, destFile.path) + self.updatedFile(url, destFile.path) if ext: - self.apt_caches[site][baseDir].file_updated(path[:-len(ext)], decFile.path) + self.updatedFile(url[:-len(ext)], decFile.path) def save_error(self, failure, url): """An error has occurred in downloadign or saving the file."""