summaryrefslogtreecommitdiff
path: root/morph-cache-server
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 17:36:00 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 17:36:00 +0100
commita58f373cec3b3bd4420478c99dde6e7fa2cba31b (patch)
tree83be97c15b6959d0eba7d1222b5114553040ef86 /morph-cache-server
parent6b762c363224860833ea20c9ba8109c0c210d419 (diff)
downloadmorph-cache-server-a58f373cec3b3bd4420478c99dde6e7fa2cba31b.tar.gz
Fix various small issues preventing bundles from working.
Diffstat (limited to 'morph-cache-server')
-rwxr-xr-xmorph-cache-server7
1 files changed, 5 insertions, 2 deletions
diff --git a/morph-cache-server b/morph-cache-server
index 5554481..57713e2 100755
--- a/morph-cache-server
+++ b/morph-cache-server
@@ -18,6 +18,7 @@
import cliapp
import logging
+import os
import urllib
from bottle import Bottle, request, response, run, static_file
@@ -48,7 +49,7 @@ class MorphCacheServer(cliapp.Application):
repo_cache = RepoCache(self,
self.settings['repo-dir'],
- self.settings['bundles'])
+ self.settings['bundle-dir'])
@app.get('/sha1s')
def sha1():
@@ -83,7 +84,9 @@ class MorphCacheServer(cliapp.Application):
def bundle():
repo = self._unescape_parameter(request.query.repo)
filename = repo_cache.get_bundle_filename(repo)
- return static_file(filename, download=True)
+ dirname = os.path.dirname(filename)
+ basename = os.path.basename(filename)
+ return static_file(basename, root=dirname, download=True)
root = Bottle()
root.mount(app, '/1.0')