forked from mirrors/gecko-dev
By default, wget prints dots every 1k bytes. This can render a lot of output for large files. We switch to the "mega" style, which makes each dot represent 64k, thus reducing output by up to 64x. We also force the use of dot display. By default, it uses "bar" which attempts to use terminal formatting if possible. Since most of this code executes in CI and terminal control characters can interfere with logged output, we force the use of "dot." (Although wget appears to automatically switch to dot in TC today. But consistency is good.) MozReview-Commit-ID: IpTWJdcauTV --HG-- extra : rebase_source : 5c9aa1bbdcd78eaa0b31347ad026a2c1beaedc03
28 lines
478 B
Bash
Executable file
28 lines
478 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
set -x
|
|
|
|
if [ -z "$root_dir" -o ! -d "$root_dir" ]; then
|
|
root_dir=$(mktemp -d)
|
|
fi
|
|
|
|
if test -z $TMPDIR; then
|
|
TMPDIR=/tmp/
|
|
fi
|
|
|
|
mkdir $root_dir/gpg
|
|
GPG="gpg --homedir $root_dir/gpg"
|
|
|
|
> $root_dir/downloads
|
|
|
|
download() {
|
|
wget -c --progress=dot:mega -P $TMPDIR $1/$2
|
|
(cd $TMPDIR; sha256sum $2) >> $root_dir/downloads
|
|
}
|
|
|
|
download_and_check() {
|
|
download $1 ${2%.*}
|
|
wget -c --progress=dot:mega -P $TMPDIR $1/$2
|
|
$GPG --verify $TMPDIR/$2 $TMPDIR/${2%.*}
|
|
}
|