diff options
-rw-r--r-- | cerbero/commands/cache.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cerbero/commands/cache.py b/cerbero/commands/cache.py index 8e9ab348..0cae283d 100644 --- a/cerbero/commands/cache.py +++ b/cerbero/commands/cache.py @@ -174,17 +174,18 @@ class FetchCache(BaseCache): return None async def fetch_dep(self, config, dep, namespace): + is_ci = 'CI' in os.environ try: dep_path = os.path.join(config.home_dir, os.path.basename(dep['url'])) m.action(f'Downloading deps cache {dep["url"]}') - await shell.download(dep['url'], dep_path, overwrite=True) - if dep['checksum'] == self.checksum(dep_path): - m.action(f'Unpacking deps cache {dep_path}') - await shell.unpack(dep_path, config.home_dir) - else: + await shell.download(dep['url'], dep_path, overwrite=is_ci) + if dep['checksum'] != self.checksum(dep_path): m.warning('Corrupted dependency file, ignoring.') - m.action('Unpack complete, deleting artifact') - os.remove(dep_path) + m.action(f'Unpacking deps cache {dep_path}') + await shell.unpack(dep_path, config.home_dir) + if is_ci: + m.action('Unpack complete, deleting artifact') + os.remove(dep_path) # We need to relocate pc files that weren't generated by meson and # python programs installed with pip because the shebang set by the |