Merge pull request #451 from metalefty/buildx-keepalive-download

buildx.sh: download tarballs using keepalive
master
metalefty 8 years ago committed by GitHub
commit c524b062dd

@ -23,23 +23,19 @@
# debian packages needed
# flex bison libxml2-dev intltool xsltproc xutils-dev python-libxml2 g++ xutils
download_file()
download_all_files()
{
local file url status
file=$1
# download files parallelly using keepalive
# a little bit faster than calling wget with single file more than 100 times
< x11_file_list.txt cut -f1 -d: | sed -e "s|^|${download_url}/|" | \
xargs -P2 -n $(expr $num_modules / 2 + 1) \
wget \
--directory-prefix=downloads \
--no-verbose \
--timestamping \
--continue
# if we already have the file, don't download it
if [ -r downloads/$file ]; then
return 0
fi
echo "downloading file $download_url/$file"
cd downloads
wget -cq $download_url/$file
status=$?
cd ..
return $status
}
@ -74,15 +70,6 @@ extract_it()
return 0
fi
# download file
if ! download_file $mod_file
then
echo ""
echo "failed to download $mod_file - aborting build"
echo ""
exit 1
fi
cd build_dir
# if pkg has not yet been extracted, do so now
@ -180,7 +167,7 @@ data_file=x11_file_list.txt
# was www.x.org/releases/X11R7.6/src/everything
download_url=http://server1.xrdp.org/xrdp/X11R7.6
num_modules=`cat $data_file | wc -l`
num_modules=`wc -l < $data_file`
count=0
##########################
@ -263,6 +250,14 @@ if ! NPROC=`nproc`; then
NPROC=1
fi
if ! download_all_files; then
echo ""
echo "download failed - aborting build"
echo "rerun this script to resume download/build"
echo ""
exit 1
fi
while IFS=: read mod_file mod_dir mod_args
do
mod_args=`eval echo $mod_args`

Loading…
Cancel
Save