| Index: cms/sources.py |
| =================================================================== |
| --- a/cms/sources.py |
| +++ b/cms/sources.py |
| @@ -211,6 +211,8 @@ |
| command = ["hg", "-R", repo, "id", "-n", "-r", "default"] |
| self.version = subprocess.check_output(command).strip() |
| + self._origin = urlparse.urlsplit(repo).path.strip('/') |
| + |
| def __enter__(self): |
| return self |
| @@ -240,6 +242,10 @@ |
| if filename.startswith(prefix): |
| yield filename[len(prefix):] |
| + if os.name == "posix": |
| + def get_cache_dir(self): |
| + return "/var/cache/" + self._origin |
| + |
| class FileSource(Source): |
| def __init__(self, dir): |
| self._dir = dir |
| @@ -280,3 +286,6 @@ |
| do_list(path, relpath + filename + "/") |
| do_list(self.get_path(subdir), "") |
| return result |
| + |
| + def get_cache_dir(self): |
| + return os.path.join(self._dir, "cache") |