Only overwrite with a tarball if we haven't already set up an install
This commit is contained in:
parent
a3882a3bc7
commit
f2aa7e2f26
@ -104,6 +104,8 @@ build-gentoo() {
|
|||||||
chmod 0600 "$file"
|
chmod 0600 "$file"
|
||||||
done
|
done
|
||||||
# We grab the checksums 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
|
||||||
|
local shouldextract=1
|
||||||
|
[ -f "$_optdest/bin/bash" ] && unset shouldextract
|
||||||
log "Downloading stage3 signature"
|
log "Downloading stage3 signature"
|
||||||
curl -s "$stage3.DIGESTS" -o "$stage3sig"
|
curl -s "$stage3.DIGESTS" -o "$stage3sig"
|
||||||
if ! [ -f "$stage3file" ]; then
|
if ! [ -f "$stage3file" ]; then
|
||||||
@ -117,8 +119,11 @@ build-gentoo() {
|
|||||||
if ! grep "$stage3sig" -e "$(sha512sum "$stage3file" | awk '{print $1}')" > /dev/null 2>&1; then
|
if ! grep "$stage3sig" -e "$(sha512sum "$stage3file" | awk '{print $1}')" > /dev/null 2>&1; then
|
||||||
error "stage3 checksum verification failed" 50
|
error "stage3 checksum verification failed" 50
|
||||||
fi
|
fi
|
||||||
log "Decompressing tarball; this will prompt for root privileges"
|
if [ -n "$shouldextract" ]; then
|
||||||
sudo tar xf "$stage3file" -C "$_optdest"
|
log "Decompressing tarball; this will prompt for root privileges"
|
||||||
|
sudo tar xf "$stage3file" -C "$_optdest"
|
||||||
|
fi
|
||||||
|
unset shouldextract
|
||||||
|
|
||||||
# Now we do some pre-chroot configuration
|
# Now we do some pre-chroot configuration
|
||||||
pushd "$_optdest" > /dev/null 2>&1
|
pushd "$_optdest" > /dev/null 2>&1
|
||||||
|
Loading…
Reference in New Issue
Block a user