Skip to content

Commit

Permalink
Merge pull request #1811 from runejuhl/fix-alpine-apk-keys
Browse files Browse the repository at this point in the history
Change alpine template file check to also check file size (`-f` => `-s`)
  • Loading branch information
stgraber committed Sep 18, 2017
2 parents 6cc7d05 + fc20af6 commit aedfcb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/lxc-alpine.in
Expand Up @@ -185,7 +185,7 @@ fetch_apk_keys() {

echo "$APK_KEYS_SHA256" | while read -r line; do
keyname="${line##* }"
if [ ! -f "$keyname" ]; then
if [ ! -s "$keyname" ]; then
fetch "$APK_KEYS_URI/$keyname" > "$keyname"
fi
echo "$line" | sha256sum -c -
Expand All @@ -210,7 +210,7 @@ fetch_apk_static() {
fetch "$MIRROR_URL/latest-stable/main/$arch/${pkg_name}-${pkg_ver}.apk" \
| tar -xz -C "$dest" sbin/ # --extract --gzip --directory

[ -f "$dest/sbin/apk.static" ] || die 2 'apk.static not found'
[ -s "$dest/sbin/apk.static" ] || die 2 'apk.static not found'

local keyname=$(echo "$dest"/sbin/apk.static.*.pub | sed 's/.*\.SIGN\.RSA\.//')
openssl dgst -sha1 \
Expand Down

0 comments on commit aedfcb8

Please sign in to comment.