fix(env): keep shellcheck and the cache-read lint green on the distro switch

The loader copies INFINITO_DISTRO into a loader-local variable before it
compares the value with the one in .env. With INFINITO_DISTRO read directly in
that condition, `shellcheck -x scripts/meta/resolve/apps.sh` reported SC2153
for INFINITO_DISTROS, which apps.sh takes from the sourced .env; with the copy
it reports nothing, as on main.

The loader test checks that .env is unchanged with filecmp against the file it
was copied from, instead of reading it twice with Path.read_bytes, which
test_no_uncached_file_reads rejects.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-10-14 01:32:24 +02:00
1 parent 1079f48feb
commit 1d970fe5bd
2 files changed
+11 -5

No files matched your search

+8 -3
View File
@@ -8,6 +8,7 @@ stay as it was.
from __future__ import annotations
import filecmp
import os
import shutil
import subprocess
@@ -93,9 +94,13 @@ class TestDistroDerivedKeys(unittest.TestCase):
shutil.copy(LOADER_DIR / name, checkout / "scripts" / "meta" / "env")
dotenv = checkout / ".env"
shutil.copy(self.scratch / "debian.env", dotenv)
before = dotenv.read_bytes()
shown = bash(f"load() {{ source scripts/meta/env/load.sh; }}\n{steps}", checkout)
self.assertEqual(dotenv.read_bytes(), before, ".env was rewritten")
shown = bash(
f"load() {{ source scripts/meta/env/load.sh; }}\n{steps}", checkout
)
self.assertTrue(
filecmp.cmp(dotenv, self.scratch / "debian.env", shallow=False),
".env was rewritten",
)
return shown
def test_the_two_distros_derive_different_keys(self):