From d905f547300455176e453e7a6b3e2a2b8e7e4934 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 27 Jan 2020 11:22:19 +0100 Subject: modules.d/dnbd3-rootfs/helper/build.inc: improve logging --- builder/modules.d/dnbd3-rootfs/helper/build.inc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builder/modules.d/dnbd3-rootfs/helper/build.inc b/builder/modules.d/dnbd3-rootfs/helper/build.inc index df866d72..9c935424 100644 --- a/builder/modules.d/dnbd3-rootfs/helper/build.inc +++ b/builder/modules.d/dnbd3-rootfs/helper/build.inc @@ -8,11 +8,6 @@ declare -rg _supported_qcow_handlers=("xmount" "kernel") # NOTE: expects 'qcow_handler' to be set in the environment, else # will only build support for xmount build_initialize_components() { - IFS='|' _pattern="^(${_supported_qcow_handlers[*]})$" export _pattern - if [[ ! "$qcow_handler" =~ $_pattern ]] ; then - logging.warn "Unknown qcow handler '$qcow_handler' - will built all known." - logging.warn "Supported handlers: ${_supported_qcow_handlers[*]}" - fi _deps_base_dir="${_mainmoddir}/binaries" # We might want to move the "binaries" repos from the dnbd3-rootfs module to main repo one day... # TODO check for its existence using modinfo -k @@ -25,7 +20,15 @@ build_initialize_components() { return 1 fi fi - # take care of the qcow handler + + # process qcow handler + logging.info "Supported handlers: ${_supported_qcow_handlers[*]}" + IFS='|' _pattern="^(${_supported_qcow_handlers[*]})$" export _pattern + if [ -z "$qcow_handler" ]; then + logging.info "No qcow handler specified, will use xmount." + elif [[ ! "$qcow_handler" =~ $_pattern ]] ; then + logging.warn "Unknown qcow handler '$qcow_handler' - will use xmount" + fi if [ -z "$qcow_handler" ] || [ "$qcow_handler" = "xmount" ]; then if [[ ! -f "${_deps_base_dir}/xmount/trunk/build/src/xmount" ]]; then logging.info "Could not find xmount binary, building it..." -- cgit v1.2.3-55-g7522