Explorar el Código

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>
Yann E. MORIN hace 1 año
padre
commit
e0fbfe3521
Se han modificado 2 ficheros con 7 adiciones y 5 borrados
  1. 3 5
      support/download/dl-wrapper
  2. 4 0
      support/download/helpers

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

+ 4 - 0
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