Remove the mirror name from the shared HTTP directory.
authorCameron Dale <camrdale@gmail.com>
Mon, 14 Jan 2008 07:24:39 +0000 (23:24 -0800)
committerCameron Dale <camrdale@gmail.com>
Mon, 14 Jan 2008 07:24:39 +0000 (23:24 -0800)
apt_dht/CacheManager.py

index 3789eae..368714d 100644 (file)
@@ -204,7 +204,8 @@ class CacheManager:
             else:
                 log.msg('Hashed file to %s: %s' % (hash.hexdigest(), url))
                 
-            urlpath, newdir = self.db.storeFile(destFile, hash.digest(), self.cache_dir)
+            mirror_dir = self.cache_dir.child(destFile.path[len(self.cache_dir.path)+1:].split('/', 1)[0])
+            urlpath, newdir = self.db.storeFile(destFile, hash.digest(), mirror_dir)
             log.msg('now avaliable at %s: %s' % (urlpath, url))
             if newdir and self.manager:
                 log.msg('A new web directory was created, so enable it')