support/download: move tracing functions to helpers

errorN() was unused, drop it.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
This commit is contained in:
Yann E. MORIN
2024-06-07 19:05:48 +02:00
committed by Arnout Vandecappelle
parent 2cbcc0f770
commit e0fbfe3521
2 changed files with 7 additions and 5 deletions

View File

@@ -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 "${@}"

View File

@@ -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