From c1a00bb944f86eecea1f063050b9f200e12dd9c8 Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Tue, 3 Oct 2017 09:49:55 +0200 Subject: [PATCH] download_and_compile.sh: write messages to the log file too Some messages added earlier regarding package alternatives weren't written to the log file, but only printed to stdout. Fix this. --- download_and_compile.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/download_and_compile.sh b/download_and_compile.sh index c66de81..e72b704 100755 --- a/download_and_compile.sh +++ b/download_and_compile.sh @@ -174,18 +174,20 @@ function _mandatory_pkg_alternative(){ local pkg if [[ $# -lt 1 ]]; then - echo "Empty package alternative: this is a bug in the script, aborting." + echo "Empty package alternative: this is a bug in the script, aborting." \ + | tee -a "$LOGFILE" exit 1 fi - echo "Considering a package alternative:" "$@" + echo "Considering a package alternative:" "$@" | tee -a "$LOGFILE" pkg=$(_find_package_alternative "$@") if [[ -n "$pkg" ]]; then - echo "Package alternative matched for $pkg" + echo "Package alternative matched for $pkg" | tee -a "$LOGFILE" PKG="$PKG $pkg" else - echo "No match found for the package alternative, aborting." + echo "No match found for the package alternative, aborting." \ + | tee -a "$LOGFILE" exit 1 fi @@ -202,19 +204,19 @@ function _optional_pkg_alternative(){ if [[ $# -lt 1 ]]; then echo "Empty optional package alternative: this is a bug in the script," \ - "aborting." + "aborting." | tee -a "$LOGFILE" exit 1 fi - echo "Considering an optional package alternative:" "$@" + echo "Considering an optional package alternative:" "$@" | tee -a "$LOGFILE" pkg=$(_find_package_alternative "$@") if [[ -n "$pkg" ]]; then - echo "Optional package alternative matched for $pkg" + echo "Optional package alternative matched for $pkg" | tee -a "$LOGFILE" PKG="$PKG $pkg" else echo "No match found for the optional package alternative, continuing" \ - "anyway." + "anyway." | tee -a "$LOGFILE" # "$*" so that we only add one element to the array in this line UNMATCHED_OPTIONAL_PKG_ALTERNATIVES+=("$*") fi