do not create empty file if wget fails (issue #422)

This commit is contained in:
Trammell hudson 2018-05-29 17:09:26 -04:00
parent 9c95b4ed58
commit 29f0f914c5
Failed to extract signature

View File

@ -225,8 +225,14 @@ define define_module =
@touch "$$@" @touch "$$@"
else else
# Fetch and verify the source tar file # Fetch and verify the source tar file
# wget creates it early, so we have to cleanup if it fails
$(packages)/$($1_tar): $(packages)/$($1_tar):
wget -O "$$@" $($1_url) $(call do,WGET,$($1_url),\
if ! wget -O "$$@" $($1_url) ; then \
rm -f "$$@" ; \
exit 1 ; \
fi \
)
$(packages)/.$1-$($1_version)_verify: $(packages)/$($1_tar) $(packages)/.$1-$($1_version)_verify: $(packages)/$($1_tar)
echo "$($1_hash) $$^" | sha256sum --check - echo "$($1_hash) $$^" | sha256sum --check -
@touch "$$@" @touch "$$@"