From 69fc1e15ec668487f114b33585800681b977f6ec Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 11 Jul 2021 00:35:50 +0300 Subject: [PATCH] kiss: fix bug when log file cannot be written --- kiss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kiss b/kiss index 8a2383e..c726692 100755 --- a/kiss +++ b/kiss @@ -774,6 +774,11 @@ pkg_build() { log "$1" "Starting build" run_hook pre-build "$1" "$pkg_dir/$1" + # Attempt to create the log file early so any permissions errors are caught + # before the build starts. 'tee' is run in a pipe and POSIX shell has no + # pipe-fail causing confusing behavior when tee fails. + : > "$log_dir/$1-$time-$pid" + # Call the build script, log the output to the terminal and to a file. # There's no PIPEFAIL in POSIX shell so we must resort to tricks like kill. { "$repo_dir/build" "$pkg_dir/$1" "$repo_ver" 2>&1 || {