Skip to content
Snippets Groups Projects
Commit faa86e27 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[bootstrap] Fix deployment if cache is not yet filled

parent 7261d424
No related branches found
No related tags found
No related merge requests found
Pipeline #26223 passed
......@@ -166,12 +166,18 @@ def merge_conda_cache(cache, prefix, name):
logger.info('Merging urls.txt files from cache...')
urls = []
cached_pkgs_urls_txt = os.path.join(cached_pkgs_dir, 'urls.txt')
logger.info('touch %s', cached_pkgs_urls_txt)
touch(cached_pkgs_urls_txt) #sometimes it does not exist yet
with open(pkgs_urls_txt, 'rb') as f1, \
open(cached_pkgs_urls_txt, 'rb') as f2:
data = set(f1.readlines() + f2.readlines())
data = sorted(list(data))
if not os.path.exists(cached_pkgs_urls_txt):
with open(pkgs_urls_txt, 'rb') as f1:
data = set(f1.readlines())
data = sorted(list(data))
else:
# use both cached and actual conda package caches
with open(pkgs_urls_txt, 'rb') as f1, \
open(cached_pkgs_urls_txt, 'rb') as f2:
data = set(f1.readlines() + f2.readlines())
data = sorted(list(data))
with open(pkgs_urls_txt, 'wb') as f:
f.writelines(data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment