Commit 100bfe8d authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmgs: download_any_tarball: use cached tarball with return, not continue

If the target tarball already exists in RPMSOURCEDIR and FORCEDOWNLOAD is not set, the previous code did 'continue' inside the FORMATS loop, which just iterated through extensions (always finding the same cached file) and ultimately fell through to 'fatal'. Move the cache check out of the loop and 'return' when a valid cached copy exists.
parent acecbc64
......@@ -187,10 +187,12 @@ download_any_tarball()
BASESOURCE=$(dirname "$BASESOURCE")/$(basename "$BASESOURCE" .$ORIGEXT)
# tarball already cached locally - use it instead of redownloading
[ -z "$FORCEDOWNLOAD" ] && check_tarball "$TARGET" && { echo "$TARGET already exists, using cached copy" ; return ; }
local ext
# try download by exts list
for ext in $FORMATS ; do
[ -z "$FORCEDOWNLOAD" ] && check_tarball "$TARGET" && { echo "$TARGET already exists, continue... " ; continue; }
download_to "$BASESOURCE.$ext" "$TARGET" || continue
return
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment