Skip to content

Commit

Permalink
Fix add-apt-keys
Browse files Browse the repository at this point in the history
Remove faulty loop as curl already has the retry option
Also add failed message
  • Loading branch information
Flamefire committed Jul 3, 2024
1 parent 05d689a commit 183b23a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ci/add-apt-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ function do_add_key
keyfilename=$(basename -s .key "$key_url")
fi
echo -e "\tDownloading APT key from '$key_url' to '$keyfilename'"
for i in {1..${NET_RETRY_COUNT:-3}}; do
curl -sSL --retry ${NET_RETRY_COUNT:-5} "$key_url" | sudo gpg --dearmor -o "/etc/apt/trusted.gpg.d/${keyfilename}" && return 0 || sleep 10
if ! curl -sSL --retry ${NET_RETRY_COUNT:-5} "$key_url" | sudo gpg --dearmor -o "/etc/apt/trusted.gpg.d/${keyfilename}"; then
echo "Failed downloading $keyfilename"
return 1
done

return 1 # Failed
}

for key_url in "$@"; do
Expand Down

0 comments on commit 183b23a

Please sign in to comment.