Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/bockbuild.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Christoforides <alexis@thenull.net>2019-06-17 19:06:38 +0300
committerAlexis Christoforides <alexis@thenull.net>2019-06-18 22:44:36 +0300
commitf8e26cc975d52ee166a156b9c15d7e83b42d200d (patch)
treec6223d2dbb0554ba337b85a0f255265d59f8fd72
parentcaf0f6dcba7d033c4f21a4c89d9fae96e116df16 (diff)
Fix cache destination
-rw-r--r--bockbuild/package.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/bockbuild/package.py b/bockbuild/package.py
index aa7380f..08a388d 100644
--- a/bockbuild/package.py
+++ b/bockbuild/package.py
@@ -338,13 +338,17 @@ class Package:
return clean_archive
def get_download_dest(url,version):
+ if version is not None:
+ dest_dir = '%s-%s' % (self.name, version)
+ else:
+ dest_dir = self.name
try:
- os.makedirs (os.path.join (source_cache_dir, version))
+ os.makedirs (os.path.join(source_cache_dir, dest_dir))
except OSError, e:
if e.errno != os.errno.EEXIST:
raise
pass
- return os.path.join(source_cache_dir, version, os.path.basename(url))
+ return os.path.join(source_cache_dir, dest_dir, os.path.basename(url))
def get_git_cache_path():
if self.organization is None:
@@ -376,7 +380,7 @@ class Package:
# raise Exception ('HTTP downloads are no longer allowed: %s', source)
if source.startswith(('http://', 'https://', 'ftp://')):
- cache = get_download_dest(source,self.version)
+ cache = get_download_dest(source, self.version)
if self.profile.cache_host is not None:
cached_source = os.path.join(
self.profile.cache_host, os.path.basename(source))