From b5725f69a3e5470180d786ceaf9356f177353ac8 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Fri, 21 Aug 2026 20:12:41 -0700 Subject: [PATCH] fix(packages): verify exact APK version --- internal/adapter/pkginstall/installer.go | 3 +-- internal/adapter/pkginstall/installer_test.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/adapter/pkginstall/installer.go b/internal/adapter/pkginstall/installer.go index e481e4c..f1e1693 100644 --- a/internal/adapter/pkginstall/installer.go +++ b/internal/adapter/pkginstall/installer.go @@ -81,8 +81,7 @@ printf '%s/apk/stable/main\n' "$REPOSITORY_ROOT" >/etc/apk/repositories apk update --no-progress >/dev/null apk add --no-progress "$@" >/dev/null for package do - actual=$(apk info -v "$package") - test "$actual" = "$package-$EXPECTED_VERSION-r0" + apk info --installed "$package=$EXPECTED_VERSION" >/dev/null done ` ) diff --git a/internal/adapter/pkginstall/installer_test.go b/internal/adapter/pkginstall/installer_test.go index 9d93143..e922d4b 100644 --- a/internal/adapter/pkginstall/installer_test.go +++ b/internal/adapter/pkginstall/installer_test.go @@ -44,6 +44,7 @@ func TestVerifyRunsThreeSignedLocalClientsWithoutNetworking(t *testing.T) { assert.Contains(t, joined, "gpgcheck=1") assert.Contains(t, joined, "repo_gpgcheck=1") assert.Contains(t, joined, "apk update") + assert.Contains(t, joined, `apk info --installed "$package=$EXPECTED_VERSION"`) assert.Contains( t, arguments,