Fix download caching, only download missing or currently empty files

This commit is contained in:
Pavel Roskin 2016-12-30 09:41:44 -08:00
parent 0afbd57638
commit 265ce37077

View File

@ -25,15 +25,23 @@
download_all_files() download_all_files()
{ {
# download files parallelly using keepalive # download files in parallel using keepalive - a little bit faster
# a little bit faster than calling wget with single file more than 100 times # than calling wget for a single file more than 100 times
< x11_file_list.txt cut -f1 -d: | sed -e "s|^|${download_url}/|" | \ urls=
for f in `cut -f1 -d: x11_file_list.txt`; do
if ! test -s "downloads/$f"; then
urls="$urls ${download_url}/$f"
fi
done
if test -n "$urls"; then
echo $urls | \
xargs -P2 -n $(expr $num_modules / 2 + 1) \ xargs -P2 -n $(expr $num_modules / 2 + 1) \
wget \ wget \
--directory-prefix=downloads \ --directory-prefix=downloads \
--no-verbose \ --no-verbose \
--timestamping \ --timestamping \
--continue --continue
fi
status=$? status=$?
return $status return $status