From b81ab657e1565ae71fb76a74dad79d79f1bb3fa9 Mon Sep 17 00:00:00 2001 From: Cameron Dale Date: Tue, 8 Jan 2008 12:38:18 -0800 Subject: [PATCH] Add back the updatedFile method to the MirrorManager. --- apt_dht/MirrorManager.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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.""" -- 2.39.2