From 0b13d28e664f00a6a0deba15c076d3f0c5ae23b5 Mon Sep 17 00:00:00 2001 From: sneak Date: Tue, 6 Oct 2026 03:39:07 +0000 Subject: [PATCH] Refresh apt package lists once in script/bootstrap (closes #115) pkg_install ran apt-get install without apt-get update. The Gitea runner image starts with empty package lists, so installing anything it lacks, such as Go, failed with "Unable to locate package". The apt branch now runs apt-get update before its first install and skips it on later calls, so a repository's own section needs no refresh of its own. Model: opus-5-5 --- TODO.md | 6 ++++++ script/bootstrap | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 80d8ca8..4f7dbfb 100644 --- a/TODO.md +++ b/TODO.md @@ -21,6 +21,12 @@ fmt-check, and commit. # Completed Steps +- 2026-10-06: The canonical `script/bootstrap` now runs `apt-get update` once, + before the first `apt-get install` of a run (issue 115). The Gitea runner + image starts with empty package lists, so installing anything it lacks, such + as Go, failed with `Unable to locate package`. A repository's own section no + longer needs a refresh of its own; `sneak/bsfirehose` and `sneak/dnswatcher` + drop theirs at their next re-vendor. - 2026-10-06: The canonical `.golangci.yml` now disables `canonicalheader` (issue 105). In golangci-lint v2.14.0 it misses findings at random in a package that also calls `ResponseWriter.Header()`, so the same tree can fail diff --git a/script/bootstrap b/script/bootstrap index 3c5ce34..799f256 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -19,6 +19,7 @@ YARN_VERSION="1.22.22" PKGMGR="" SUDO="" +APT_UPDATED="" detect_pkgmgr() { [ -n "$PKGMGR" ] && return 0 @@ -47,7 +48,14 @@ pkg_install() { detect_pkgmgr case "$PKGMGR" in nix) nix-env -iA "nixpkgs.$1" ;; - apt) $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y "$2" ;; + apt) + # Package lists may be empty (fresh images); refresh once per run. + if [ -z "$APT_UPDATED" ]; then + $SUDO env DEBIAN_FRONTEND=noninteractive apt-get update + APT_UPDATED=1 + fi + $SUDO env DEBIAN_FRONTEND=noninteractive apt-get install -y "$2" + ;; brew) brew install "$3" ;; apk) apk add --no-cache "$4" ;; esac