From 2349b61bb2d75328eca41eb216eb928dafbc4a4f Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 14 Jun 2019 15:07:59 -0400 Subject: Cached binary-not-source in a versioned directory Maybe this fixes https://github.com/mono/mono/issues/14957 --- bockbuild/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bockbuild/package.py b/bockbuild/package.py index 84a66b1..330eb55 100644 --- a/bockbuild/package.py +++ b/bockbuild/package.py @@ -337,8 +337,8 @@ class Package: return clean_archive - def get_download_dest(url): - return os.path.join(source_cache_dir, os.path.basename(url)) + def get_download_dest(url,version): + return os.path.join(source_cache_dir, version, os.path.basename(url)) def get_git_cache_path(): if self.organization is None: @@ -370,7 +370,7 @@ class Package: # raise Exception ('HTTP downloads are no longer allowed: %s', source) if source.startswith(('http://', 'https://', 'ftp://')): - cache = get_download_dest(source) + 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)) -- cgit v1.2.3 From caf0f6dcba7d033c4f21a4c89d9fae96e116df16 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Fri, 14 Jun 2019 15:33:14 -0400 Subject: Gotta mkdir in the cache now --- bockbuild/package.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bockbuild/package.py b/bockbuild/package.py index 330eb55..aa7380f 100644 --- a/bockbuild/package.py +++ b/bockbuild/package.py @@ -338,6 +338,12 @@ class Package: return clean_archive def get_download_dest(url,version): + try: + os.makedirs (os.path.join (source_cache_dir, version)) + except OSError, e: + if e.errno != os.errno.EEXIST: + raise + pass return os.path.join(source_cache_dir, version, os.path.basename(url)) def get_git_cache_path(): -- cgit v1.2.3 From f8e26cc975d52ee166a156b9c15d7e83b42d200d Mon Sep 17 00:00:00 2001 From: Alexis Christoforides Date: Mon, 17 Jun 2019 12:06:38 -0400 Subject: Fix cache destination --- bockbuild/package.py | 10 +++++++--- 1 file 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)) -- cgit v1.2.3