Print progress for tar download
This commit is contained in:
parent
6d5ebf5613
commit
7bbb04c5a8
1 changed files with 17 additions and 15 deletions
32
install.sh
32
install.sh
|
@ -41,8 +41,8 @@ parse_args() {
|
||||||
}
|
}
|
||||||
execute() {
|
execute() {
|
||||||
tmpdir=$(mktemp -d)
|
tmpdir=$(mktemp -d)
|
||||||
log_debug "downloading image into ${tmpdir}"
|
log_info "downloading image into ${tmpdir}"
|
||||||
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}"
|
http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}" "" "1"
|
||||||
docker load --input "${tmpdir}/${TARBALL}"
|
docker load --input "${tmpdir}/${TARBALL}"
|
||||||
docker tag "rosetta-bitcoin:${TAG}" "rosetta-bitcoin:latest"
|
docker tag "rosetta-bitcoin:${TAG}" "rosetta-bitcoin:latest"
|
||||||
log_info "installed rosetta-bitcoin:${TAG} and tagged as rosetta-bitcoin:latest"
|
log_info "installed rosetta-bitcoin:${TAG} and tagged as rosetta-bitcoin:latest"
|
||||||
|
@ -111,15 +111,6 @@ log_crit() {
|
||||||
log_priority 2 || return 0
|
log_priority 2 || return 0
|
||||||
echoerr "$(log_prefix)" "$(log_tag 2)" "$@"
|
echoerr "$(log_prefix)" "$(log_tag 2)" "$@"
|
||||||
}
|
}
|
||||||
uname_os() {
|
|
||||||
os=$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
||||||
case "$os" in
|
|
||||||
cygwin_nt*) os="windows" ;;
|
|
||||||
mingw*) os="windows" ;;
|
|
||||||
msys_nt*) os="windows" ;;
|
|
||||||
esac
|
|
||||||
echo "$os"
|
|
||||||
}
|
|
||||||
untar() {
|
untar() {
|
||||||
tarball=$1
|
tarball=$1
|
||||||
case "${tarball}" in
|
case "${tarball}" in
|
||||||
|
@ -136,10 +127,15 @@ http_download_curl() {
|
||||||
local_file=$1
|
local_file=$1
|
||||||
source_url=$2
|
source_url=$2
|
||||||
header=$3
|
header=$3
|
||||||
|
loud=$4
|
||||||
|
quiet_var="-L"
|
||||||
|
if [ -z "$loud" ]; then
|
||||||
|
quiet_var="-sL"
|
||||||
|
fi
|
||||||
if [ -z "$header" ]; then
|
if [ -z "$header" ]; then
|
||||||
code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url")
|
code=$(curl -w '%{http_code}' "$quiet_var" -o "$local_file" "$source_url")
|
||||||
else
|
else
|
||||||
code=$(curl -w '%{http_code}' -sL -H "$header" -o "$local_file" "$source_url")
|
code=$(curl -w '%{http_code}' "$quiet_var" -H "$header" -o "$local_file" "$source_url")
|
||||||
fi
|
fi
|
||||||
if [ "$code" != "200" ]; then
|
if [ "$code" != "200" ]; then
|
||||||
log_debug "http_download_curl received HTTP status $code"
|
log_debug "http_download_curl received HTTP status $code"
|
||||||
|
@ -151,10 +147,16 @@ http_download_wget() {
|
||||||
local_file=$1
|
local_file=$1
|
||||||
source_url=$2
|
source_url=$2
|
||||||
header=$3
|
header=$3
|
||||||
|
loud=$4
|
||||||
|
quiet_var=""
|
||||||
|
if [ -z "$loud" ]; then
|
||||||
|
quiet_var="-q"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$header" ]; then
|
if [ -z "$header" ]; then
|
||||||
wget -q -O "$local_file" "$source_url"
|
wget "$quiet_var" -O "$local_file" "$source_url"
|
||||||
else
|
else
|
||||||
wget -q --header "$header" -O "$local_file" "$source_url"
|
wget "$quiet_var" --header "$header" -O "$local_file" "$source_url"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
http_download() {
|
http_download() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue