From 26d72d3048bac0552b3e513b85b8585acef3723e Mon Sep 17 00:00:00 2001 From: Tom Needham <06needhamt@gmail.com> Date: Sun, 14 Mar 2021 12:14:22 +0000 Subject: [PATCH] Ports: Allow verbose argument in build_all.sh This patch allows for a verbose argument to be passed so that the build output of the individual builds is printed to stdout instead of /dev/null to help with diagnosing errors If the verbose argument is not passed the old behaviour is preserved and the build output is printed to /dev/null --- Ports/build_all.sh | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/Ports/build_all.sh b/Ports/build_all.sh index 1f69bd3862..9719dd7d48 100755 --- a/Ports/build_all.sh +++ b/Ports/build_all.sh @@ -1,10 +1,26 @@ #!/usr/bin/env bash clean=false +verbose=false + case "$1" in clean) clean=true ;; + verbose) + verbose=true + ;; + *) + ;; +esac + +case "$2" in + clean) + clean=true + ;; + verbose) + verbose=true + ;; *) ;; esac @@ -16,13 +32,26 @@ for file in *; do pushd $file > /dev/null dirname=$(basename $file) if [ "$clean" == true ]; then - ./package.sh clean_all > /dev/null 2>&1 + if [ "$verbose" == true ]; then + ./package.sh clean_all + else + ./package.sh clean_all > /dev/null 2>&1 + fi fi - if $(./package.sh > /dev/null 2>&1 ); then - echo "Built ${dirname}." + if [ "$verbose" == true ]; then + if $(./package.sh); then + echo "Built ${dirname}." + else + echo "ERROR: Build of ${dirname} was not successful!" + some_failed=true + fi else - echo "ERROR: Build of ${dirname} was not successful!" - some_failed=true + if $(./package.sh > /dev/null 2>&1); then + echo "Built ${dirname}." + else + echo "ERROR: Build of ${dirname} was not successful!" + some_failed=true + fi fi popd > /dev/null fi