From 874e6cd24d22030731ef865c503243fb3efd660e Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Wed, 20 May 2026 23:43:37 -0400 Subject: [PATCH] Cache ISO mirror by channel instead of by date The previous per-day cache (iso_YYYY-MM-DD) forced a fresh ~6GB download on the first build of every day. Different channels (stable/edge/rc) HAVE different package sets and shouldn't share a cache, but different DAYS within a channel don't, so keying by channel gives us a stable cache that persists indefinitely. omarchy* packages always rebuild fresh inside the container regardless: build-omarchy-packages.sh nukes /tmp/omarchy-pkg-build at the start and the final mv overwrites the cached .pkg.tar.zst (pkgver is constant). --no-cache still bypasses the mount entirely for a clean-slate run. --- bin/omarchy-iso-make | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/omarchy-iso-make b/bin/omarchy-iso-make index c91cfcd..e79e116 100755 --- a/bin/omarchy-iso-make +++ b/bin/omarchy-iso-make @@ -102,13 +102,16 @@ if [ -d "/var/cache/pacman/pkg" ]; then DOCKER_ARGS+=(-v "/var/cache/pacman/pkg:/var/cache/pacman/pkg") fi -# Mount the build cache directory where packages are downloaded +# Mount the build cache directory where packages are downloaded. Keyed by +# channel so stable/edge/rc don't pollute each other but the cache persists +# across days (different channels have different package sets; days don't). +# omarchy* packages always rebuild fresh inside the container regardless of +# what's in the cache (build-omarchy-packages.sh nukes its work dir and the +# final mv overwrites the cached .pkg.tar.zst). --no-cache bypasses the mount +# entirely if you want a truly clean download. if [[ -z "$NO_CACHE" ]]; then - # using a dated dir on the host to refresh daily if building multiple times - BUILD_DATE=$(date +%Y-%m-%d) - OFFLINE_REPO_BUILD_CACHE_DIR="$HOME/.cache/omarchy/iso_${BUILD_DATE}/airootfs/var/cache/omarchy" + OFFLINE_REPO_BUILD_CACHE_DIR="$HOME/.cache/omarchy/iso_${OMARCHY_MIRROR}/airootfs/var/cache/omarchy" mkdir -p "$OFFLINE_REPO_BUILD_CACHE_DIR" - # Mount to /var/cache/airootfs/var/cache/omarchy since that's where repo packages go in the ISO DOCKER_ARGS+=(-v "$OFFLINE_REPO_BUILD_CACHE_DIR:/var/cache/airootfs/var/cache/omarchy") fi