diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper index d1ba281f79..239bdfa359 100755 --- a/support/download/dl-wrapper +++ b/support/download/dl-wrapper @@ -17,6 +17,9 @@ # We want to catch any unexpected failure, and exit immediately. set -e +# shellcheck source=helpers source-path=SCRIPTDIR +. "${0%/*}/helpers" + export BR_BACKEND_DL_GETOPTS=":hc:d:o:n:N:H:lru:qf:e" main() { @@ -233,10 +236,5 @@ main() { return ${rc} } -trace() { local msg="${1}"; shift; printf "%s: ${msg}" "${my_name}" "${@}"; } -warn() { trace "${@}" >&2; } -errorN() { local ret="${1}"; shift; warn "${@}"; exit "${ret}"; } -error() { errorN 1 "${@}"; } - my_name="${0##*/}" main "${@}" diff --git a/support/download/helpers b/support/download/helpers index 5ed9078287..f4102e3b06 100755 --- a/support/download/helpers +++ b/support/download/helpers @@ -94,5 +94,9 @@ post_process_repack() { mk_tar_gz "${in_dir}/${base_dir}" "${base_dir}" "${date}" "${out}" } +trace() { local msg="${1}"; shift; printf "%s: ${msg}" "${my_name}" "${@}"; } +warn() { trace "${@}" >&2; } +error() { warn "${@}"; exit 1; } + # Keep this line and the following as last lines in this file. # vim: ft=bash