Browse Source

build script: Fix message on failed download (fixes #456) (#457)

Message displayed when file download fails, shows wrong information
about maximum number of attempts. Hardcoded value of '3' is shown,
but in reality there is up to six attempts (when subsequent downloads
keep failing).
Fix it by using correct value.
android-5
Mariusz 8 years ago
committed by Fredrik Fornwall
parent
commit
6ad2991cb1
  1. 5
      build-package.sh

5
build-package.sh

@ -161,7 +161,8 @@ termux_download() {
TMPFILE=`mktemp $TERMUX_PKG_TMPDIR/download.$TERMUX_PKG_NAME.XXXXXXXXX` TMPFILE=`mktemp $TERMUX_PKG_TMPDIR/download.$TERMUX_PKG_NAME.XXXXXXXXX`
echo "Downloading ${URL}" echo "Downloading ${URL}"
for i in 1 2 3 4 5 6; do TRYMAX=6
for try in $(seq 1 $TRYMAX); do
if curl -L --fail --retry 2 -o "$TMPFILE" "$URL"; then if curl -L --fail --retry 2 -o "$TMPFILE" "$URL"; then
if [ $# = 3 ]; then if [ $# = 3 ]; then
# Optional checksum argument: # Optional checksum argument:
@ -173,7 +174,7 @@ termux_download() {
mv "$TMPFILE" "$DESTINATION" mv "$TMPFILE" "$DESTINATION"
return return
else else
echo "Download of $1 failed (attempt $i/3)" 1>&2 echo "Download of $1 failed (attempt $try/$TRYMAX)" 1>&2
sleep 45 sleep 45
fi fi
done done

Loading…
Cancel
Save