wget --timeout=1 is too short. Change to --timeout=2
The test for whether or not a given repo is available often fails when it shouldn't. If I run the test two consecutive times, it is often the case that the first test will fail and the second test will succeed. The fix for me was to increase the timeout time from '1' to '2'. This is a further modification to my second correction in issue #69.
My new code is:
wget --quiet --timeout=2 --no-parent --spider "${URL}" && \
{
# set the current URL
curr_repo_url="$URL"
if [ ! -z "$curr_repo_url" ]; then
echo "$curr_repo_url" > $TMPDIR/curr_repo_url
break
fi
}
The orginal code is: /master/usr/sbin/pkg#L4295
BTW, I'm not sure if the increased timeout is required more due to issues with my network or issues with the devuan repo.