mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 01:28:35 -05:00
fix(docker): skip tlmgr install for collections install-tl already provided
The 16:23 container rebuild caught a real flaky failure with the previous commit's stricter exit-non-zero behavior: collection-fontsrecommended failed twice when tlmgr's mirror.ctan.org redirect landed on stale mirrors (ctan.math.illinois then mirrors.mit). On a stale mirror tlmgr refuses with a silent 'Remote database at <url>' / exit 1, never reaching the 'package already present' fast-path that would have succeeded against a fresh mirror. install-tl's scheme-medium already installs basic, fontsrecommended, fontutils, latex, latexrecommended, luatex, pictures, plus most language collections — 7 of the 9 entries in tl_packages. Only fontsextra and latexextra genuinely need a tlmgr install operation. Query the local tlpdb with 'tlmgr info --only-installed' (no network) and skip the network call entirely when the collection is already present, sidestepping the random-mirror staleness for the redundant entries.
This commit is contained in:
@@ -43,8 +43,22 @@ failed_packages=""
|
||||
while IFS= read -r collection; do
|
||||
case "$collection" in
|
||||
collection-*)
|
||||
printf '%s\n' "📦 [$i/$collection_count] Installing $collection..."
|
||||
printf '%s\n' "📦 [$i/$collection_count] Processing $collection..."
|
||||
if command -v tlmgr >/dev/null 2>&1; then
|
||||
# install-tl already installs most of these via scheme-medium (basic,
|
||||
# fontsrecommended, fontutils, latex, latexrecommended, luatex,
|
||||
# pictures, ...). Calling 'tlmgr install <already-present>' against
|
||||
# mirror.ctan.org's random-mirror redirect can hit a stale mirror that
|
||||
# refuses with a silent version-mismatch exit 1 — the failure mode that
|
||||
# took down the 2026-05-04 16:23 build for collection-fontsrecommended.
|
||||
# Query the local tlpdb (no network) first and skip if already installed;
|
||||
# only collections that genuinely need network install (e.g. fontsextra,
|
||||
# latexextra) reach the tlmgr install retry loop.
|
||||
if tlmgr info --only-installed "$collection" 2>/dev/null | grep -q '^package:'; then
|
||||
printf '%s\n' "✅ $collection already installed locally (no network call)"
|
||||
i=$(expr "$i" + 1)
|
||||
continue
|
||||
fi
|
||||
success=false
|
||||
for retry in 1 2; do
|
||||
# Capture tlmgr stdout+stderr so its actual error message reaches the
|
||||
|
||||
Reference in New Issue
Block a user