mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
nix-channels: Also download nix-cache-info
This commit is contained in:
parent
cbd2e9f802
commit
7a75219065
@ -261,6 +261,8 @@ def clone_channels():
|
|||||||
def update_channels(channels):
|
def update_channels(channels):
|
||||||
logging.info(f'- Updating binary cache')
|
logging.info(f'- Updating binary cache')
|
||||||
|
|
||||||
|
has_cache_info = False
|
||||||
|
|
||||||
for channel in channels:
|
for channel in channels:
|
||||||
logging.info(f' - {channel}')
|
logging.info(f' - {channel}')
|
||||||
|
|
||||||
@ -268,6 +270,18 @@ def update_channels(channels):
|
|||||||
|
|
||||||
upstream_binary_cache = (chan_path_update / '.original-binary-cache-url').read_text()
|
upstream_binary_cache = (chan_path_update / '.original-binary-cache-url').read_text()
|
||||||
|
|
||||||
|
# All the channels should have https://cache.nixos.org as binary cache
|
||||||
|
# URL. We download nix-cache-info here (once per sync) to avoid
|
||||||
|
# hard-coding it, and in case it changes.
|
||||||
|
if not has_cache_info:
|
||||||
|
info_file = 'nix-cache-info'
|
||||||
|
logging.info(f' - Downloading {info_file}')
|
||||||
|
download(
|
||||||
|
f'{upstream_binary_cache}/{info_file}',
|
||||||
|
working_dir / STORE_DIR / info_file
|
||||||
|
)
|
||||||
|
has_cache_info = True
|
||||||
|
|
||||||
with lzma.open(str(chan_path_update / 'store-paths.xz')) as f:
|
with lzma.open(str(chan_path_update / 'store-paths.xz')) as f:
|
||||||
paths = [ path.rstrip() for path in f ]
|
paths = [ path.rstrip() for path in f ]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user