From f1616d0d021362fc3c72f4d68eb976ecd8175840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Wed, 2 Feb 2022 21:23:41 +0100 Subject: [PATCH] Logging fixes --- fragments/functions.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index a7cc17e..691c7e9 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -461,7 +461,9 @@ installAppWithPath() { # $1: path to app to install in $targetDir if [ -e "$targetDir/$appName" ]; then printlog "Removing existing $targetDir/$appName" DEBUG deleteAppOut=$(rm -Rfv "$targetDir/$appName" 2>&1) - printlog "Debugging enabled, App removing output was:\n$deleteAppOut" DEBUG + deleteAppOut=$(echo $deleteAppOut | cut -c 1-80) + deduplicatelogs "$deleteAppOut" + printlog "Debugging enabled, App removing output was:\n$logoutput" DEBUG fi # copy app to /Applications @@ -485,7 +487,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir CLIoutput=$("$mountname/$CLIInstaller" "${CLIArguments[@]}" 2>&1) CLIstatus=$(echo $?) - dedupliatelogs "$CLIoutput" + deduplicatelogs "$CLIoutput" if [ $CLIstatus -ne 0 ] ; then cleanupAndExit 3 "Error installing $mountname/$CLIInstaller $CLIArguments error:\n$logoutput" ERROR @@ -597,7 +599,7 @@ installFromPKG() { pkgInstallStatus=$(echo $?) sleep 1 pkgEndTime=$(date "+$LogDateFormat") - pkgInstall+=$(echo "Output of /var/log/install.log below this line.\n") + pkgInstall+=$(echo "\nOutput of /var/log/install.log below this line.\n") pkgInstall+=$(echo "----------------------------------------------------------\n") pkgInstall+=$(awk -v "b=$starttime" -v "e=$pkgEndTime" -F ',' '$1 >= b && $1 <= e' /var/log/install.log) deduplicatelogs "$pkgInstall"