mirror of
https://github.com/lxc/lxc-templates.git
synced 2024-12-22 06:20:13 +00:00
lxc-alpine: variable for apk.static path
Signed-off-by: Kaarle Ritvanen <kunkku@alpinelinux.org>
This commit is contained in:
parent
26b4468b26
commit
7c3b65b0ef
@ -219,17 +219,18 @@ fetch_apk_static() {
|
|||||||
fetch "$MIRROR_URL/latest-stable/main/$arch/${pkg_name}-${pkg_ver}.apk" \
|
fetch "$MIRROR_URL/latest-stable/main/$arch/${pkg_name}-${pkg_ver}.apk" \
|
||||||
| tar -xz -C "$dest" sbin/ # --extract --gzip --directory
|
| 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 \
|
openssl dgst -sha1 \
|
||||||
-verify "$APK_KEYS_DIR/$keyname" \
|
-verify "$APK_KEYS_DIR/$keyname" \
|
||||||
-signature "$dest/sbin/apk.static.SIGN.RSA.$keyname" \
|
-signature "$dest/sbin/apk.static.SIGN.RSA.$keyname" \
|
||||||
"$dest/sbin/apk.static" \
|
"$apk" \
|
||||||
|| die 2 'Signature verification for apk.static failed'
|
|| die 2 'Signature verification for apk.static failed'
|
||||||
|
|
||||||
# Note: apk doesn't return 0 for --version
|
# Note: apk doesn't return 0 for --version
|
||||||
local out="$("$dest"/sbin/apk.static --version)"
|
local out=$("$apk" --version)
|
||||||
echo "$out"
|
echo "$out"
|
||||||
|
|
||||||
[ "${out%% *}" = 'apk-tools' ] || die 3 'apk.static --version failed'
|
[ "${out%% *}" = 'apk-tools' ] || die 3 'apk.static --version failed'
|
||||||
|
Loading…
Reference in New Issue
Block a user