mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-15 10:10:54 +00:00
download: Fix download_sig logic
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
83b4b1dca8
commit
33aa351ac1
@ -73,10 +73,17 @@ download_file() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
download_sig() {
|
download_sig() {
|
||||||
download_file $1 $2 noexit
|
if ! download_file $1 $2 noexit; then
|
||||||
if [ "$DOWNLOAD_VALIDATE" = "true" ]; then
|
if [ "$DOWNLOAD_VALIDATE" = "true" ]; then
|
||||||
|
if [ "$3" = "normal" ]; then
|
||||||
echo "ERROR: Failed to download http://${DOWNLOAD_SERVER}/$1" 1>&2
|
echo "ERROR: Failed to download http://${DOWNLOAD_SERVER}/$1" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,11 +275,11 @@ if [ "$DOWNLOAD_USE_CACHE" = "false" ]; then
|
|||||||
echo "Downloading the image index"
|
echo "Downloading the image index"
|
||||||
if ! download_file ${DOWNLOAD_INDEX_PATH}.${DOWNLOAD_COMPAT_LEVEL} \
|
if ! download_file ${DOWNLOAD_INDEX_PATH}.${DOWNLOAD_COMPAT_LEVEL} \
|
||||||
${DOWNLOAD_TEMP}/index noexit ||
|
${DOWNLOAD_TEMP}/index noexit ||
|
||||||
! download_file ${DOWNLOAD_INDEX_PATH}.${DOWNLOAD_COMPAT_LEVEL}.asc \
|
! download_sig ${DOWNLOAD_INDEX_PATH}.${DOWNLOAD_COMPAT_LEVEL}.asc \
|
||||||
${DOWNLOAD_TEMP}/index.asc noexit; then
|
${DOWNLOAD_TEMP}/index.asc noexit; then
|
||||||
download_file ${DOWNLOAD_INDEX_PATH} ${DOWNLOAD_TEMP}/index normal
|
download_file ${DOWNLOAD_INDEX_PATH} ${DOWNLOAD_TEMP}/index normal
|
||||||
download_sig ${DOWNLOAD_INDEX_PATH}.asc \
|
download_sig ${DOWNLOAD_INDEX_PATH}.asc \
|
||||||
${DOWNLOAD_TEMP}/index.asc
|
${DOWNLOAD_TEMP}/index.asc normal
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gpg_validate ${DOWNLOAD_TEMP}/index.asc
|
gpg_validate ${DOWNLOAD_TEMP}/index.asc
|
||||||
|
Loading…
Reference in New Issue
Block a user