Problem
Four bundled recipes carry the same Alpine repository setup. devtools,
build-deps, service-tools, and pkg-tools each open install-alpine.sh
with the same loop:
n=0
until setup-apkrepos -c -1; do
n=$((n + 1))
[ "$n" -ge 30 ] && { echo "apk database stayed locked; giving up" >&2; exit 1; }
sleep 2
done
Each copy carries a different comment, and each one skips stoat_pkg_setup.
The Global Constraints for a bundled recipe say every script calls
stoat_pkg_setup before it installs, so all four scripts state an exception.
Cause
Alpine's guest prelude defines stoat_pkg_setup as apk update. That command
does not enable the community repository, and it does not wait for the apk
database lock. setup-apkrepos -c -1 does both. No recipe wants what the
prelude offers, so every recipe replaced it.
Proposal
Move the loop into Alpine's stoat_pkg_setup in
internal/guest/bundled/alpine.toml. The four scripts then call
stoat_pkg_setup like the scripts for every other guest, the exception
disappears, and the retry behaviour has one definition.
Acceptance criteria
internal/guest/bundled/alpine.toml performs the mirror selection, the
community repository, the index refresh, and the lock retry.
- The four
install-alpine.sh scripts call stoat_pkg_setup and hold no
repository logic.
- A test covers the retry: a locked database returns non-zero, and the setup
verb tries again.
- The Alpine row of the recipe live matrix passes with the recipes selected
together.
Evidence
Found by the whole-branch review of #100. The duplication is byte-identical
apart from the comments.
Problem
Four bundled recipes carry the same Alpine repository setup.
devtools,build-deps,service-tools, andpkg-toolseach openinstall-alpine.shwith the same loop:
Each copy carries a different comment, and each one skips
stoat_pkg_setup.The Global Constraints for a bundled recipe say every script calls
stoat_pkg_setupbefore it installs, so all four scripts state an exception.Cause
Alpine's guest prelude defines
stoat_pkg_setupasapk update. That commanddoes not enable the community repository, and it does not wait for the apk
database lock.
setup-apkrepos -c -1does both. No recipe wants what theprelude offers, so every recipe replaced it.
Proposal
Move the loop into Alpine's
stoat_pkg_setupininternal/guest/bundled/alpine.toml. The four scripts then callstoat_pkg_setuplike the scripts for every other guest, the exceptiondisappears, and the retry behaviour has one definition.
Acceptance criteria
internal/guest/bundled/alpine.tomlperforms the mirror selection, thecommunity repository, the index refresh, and the lock retry.
install-alpine.shscripts callstoat_pkg_setupand hold norepository logic.
verb tries again.
together.
Evidence
Found by the whole-branch review of #100. The duplication is byte-identical
apart from the comments.