Skip to content

Commit 8917ddc

Browse files
committed
Download the zen-internals binaries again when the version changes
1 parent 61561f3 commit 8917ddc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎Makefile‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,21 @@ FILES = \
6666
libzen_internals_x86_64-unknown-linux-musl.so.sha256sum
6767

6868
binaries: binaries_make_dir $(addprefix .cache/binaries/, $(FILES))
69+
echo "$(BASE_URL)" > $(CACHE_DIR)/.version
6970
binaries_make_dir:
7071
rm -rf .cache/binaries
7172
mkdir -p .cache/binaries/
7273
.cache/binaries/%:
7374
@echo "Downloading $*..."
7475
curl -L -o $@ $(BASE_URL)/$*
7576

77+
# Binaries from another release may not match the Python bindings, so download them again.
7678
.PHONY: check_binaries
7779
check_binaries:
78-
@if [ -d "$(CACHE_DIR)" ]; then \
79-
echo "Directory $(CACHE_DIR) exists."; \
80+
@if [ "$$(cat $(CACHE_DIR)/.version 2>/dev/null)" = "$(BASE_URL)" ]; then \
81+
echo "Directory $(CACHE_DIR) has the binaries from $(BASE_URL)."; \
8082
else \
81-
echo "Directory $(CACHE_DIR) is empty. Running 'make binaries'..."; \
83+
echo "Directory $(CACHE_DIR) is missing or outdated. Running 'make binaries'..."; \
8284
$(MAKE) binaries; \
8385
fi
8486

0 commit comments

Comments
 (0)