From 7c3b65b0efeaa87f33b3065869925e408d42e54a Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Tue, 10 Dec 2024 15:16:08 +0200 Subject: [PATCH] lxc-alpine: variable for apk.static path Signed-off-by: Kaarle Ritvanen --- templates/lxc-alpine.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 535d0ef..5667144 100644 --- a/templates/lxc-alpine.in +++ b/templates/lxc-alpine.in @@ -219,17 +219,18 @@ fetch_apk_static() { fetch "$MIRROR_URL/latest-stable/main/$arch/${pkg_name}-${pkg_ver}.apk" \ | tar -xz -C "$dest" sbin/ # --extract --gzip --directory - [ -s "$dest/sbin/apk.static" ] || die 2 'apk.static not found' + local apk=$dest/sbin/apk.static + [ -s "$apk" ] || die 2 'apk.static not found' - local keyname=$(echo "$dest"/sbin/apk.static.*.pub | sed 's/.*\.SIGN\.RSA\.//') + local keyname=$(echo "$apk".*.pub | sed 's/.*\.SIGN\.RSA\.//') openssl dgst -sha1 \ -verify "$APK_KEYS_DIR/$keyname" \ -signature "$dest/sbin/apk.static.SIGN.RSA.$keyname" \ - "$dest/sbin/apk.static" \ + "$apk" \ || die 2 'Signature verification for apk.static failed' # Note: apk doesn't return 0 for --version - local out="$("$dest"/sbin/apk.static --version)" + local out=$("$apk" --version) echo "$out" [ "${out%% *}" = 'apk-tools' ] || die 3 'apk.static --version failed'