Use digests and not digests.asc
This commit is contained in:
parent
1efc45ad5f
commit
56a34c9306
@ -98,25 +98,25 @@ build-gentoo() {
|
|||||||
| head -n 1
|
| head -n 1
|
||||||
)"
|
)"
|
||||||
stage3file="/tmp/tmp.$USER.$_name.stage3.tar.xz"
|
stage3file="/tmp/tmp.$USER.$_name.stage3.tar.xz"
|
||||||
stage3sig="/tmp/tmp.$USER.$_name.stage3.tar.xz.DIGESTS.asc"
|
stage3sig="/tmp/tmp.$USER.$_name.stage3.tar.xz.DIGESTS"
|
||||||
for file in "$stage3file" "$stage3sig"; do
|
for file in "$stage3file" "$stage3sig"; do
|
||||||
touch "$file"
|
touch "$file"
|
||||||
chmod 0600 "$file"
|
chmod 0600 "$file"
|
||||||
done
|
done
|
||||||
trap "cleanup $stage3file" EXIT
|
trap "cleanup $stage3file" EXIT
|
||||||
# We grab the signature first to verify the integrity of any tarball leftover from a previous run
|
# We grab the checksums first to verify the integrity of any tarball leftover from a previous run
|
||||||
log "Downloading stage3 signature"
|
log "Downloading stage3 signature"
|
||||||
curl -s "$stage3.DIGESTS.asc" -o "$stage3sig"
|
curl -s "$stage3.DIGESTS" -o "$stage3sig"
|
||||||
if ! [ -f "$stage3file" ]; then
|
if ! [ -f "$stage3file" ]; then
|
||||||
log "Downloading stage3"
|
log "Downloading stage3"
|
||||||
curl -s "$stage3" -o "$stage3file"
|
curl -s "$stage3" -o "$stage3file"
|
||||||
elif ! openssl dgst -r -sha512 "$stage3file"; then
|
elif ! openssl dgst -r -sha512 "$stage3file"; then
|
||||||
log "Signature verification failed; downloading new stage3"
|
log "Checksum verification failed; downloading new stage3"
|
||||||
curl -s "$stage3" -o "$stage3file"
|
curl -s "$stage3" -o "$stage3file"
|
||||||
fi
|
fi
|
||||||
# At this point, we should have a new stage3 that matches our signature; die of not
|
# At this point, we should have a new stage3 that matches our signature; die of not
|
||||||
if ! openssl dgst -r -sha512 "$stage3file"; then
|
if ! openssl dgst -r -sha512 "$stage3file"; then
|
||||||
error "stage3 signature verification failed" 50
|
error "stage3 checksum verification failed" 50
|
||||||
fi
|
fi
|
||||||
log "Decompressing tarball; this will prompt for root privileges"
|
log "Decompressing tarball; this will prompt for root privileges"
|
||||||
sudo tar xf "$stage3file" -C "$_optdest"
|
sudo tar xf "$stage3file" -C "$_optdest"
|
||||||
|
Loading…
Reference in New Issue
Block a user