Skip to content

Commit

Permalink
[bin/sailfishos-chum-gui-installer] Fix debug output formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Olf0 authored Jun 13, 2024
1 parent 5cb477c commit 964b7ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/sailfishos-chum-gui-installer
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ source /etc/os-release; logentry="[Debug] From /etc/os-release: $ID $VERSION_ID
printf '\n%s\n' "$(date -Iseconds) $logentry"
systemd-cat -t "$called" -p 7 printf '%s' "$logentry"

ssus="$(ssu s | grep -iv 'UID:\? ')"; logentry='[Debug] \`ssu status\`, UID omitted:'
ssus="$(ssu s | grep -iv 'UID:\? ')"; logentry='[Debug] `ssu status`, UID omitted:'
printf '\n%s\n%s\n' "$(date -Iseconds) $logentry" "$ssus"
systemd-cat -t "$called" -p 7 printf '%s %s' "$logentry" "$(printf '%s' "$ssus" | sed 's/$/, /g' | tr -d '\n')"

Expand Down Expand Up @@ -227,7 +227,7 @@ logentry='pkcon -pvy install sailfishos-chum-gui'
# except for the final log message.
setsid --fork sh -c '(sleep 1;\
i=0; while [ $i -le 9 ] && ps -eo pid | fgrep -q "$1"; do sleep 1; i=$(($i+1)); done;\
printf '\n%s\n' "$(date -Iseconds) [Step 2 / 2] $2";\
printf "\n%s\n" "$(date -Iseconds) [Step 2 / 2] $2";\
systemd-cat -t "$3" -p 6 printf '%s' "[Info] Executing: $2";\
eval $2)' sh_do_inst-chum-gui "$mypid" "$logentry" "$called"
# The first 15 characters of the spawned process' name
Expand All @@ -239,7 +239,7 @@ setsid --fork sh -c '(sleep 1;\
# For a detailed description of double-forking in shell code, see
# https://github.com/storeman-developers/harbour-storeman-installer/blob/master/double-fork-in-shell.md
logentry="[Debug] ${called}'s main script (PID: ${mypid}) finishes"
printf '\n%s\n' "$(date -Iseconds) $logentry"
printf '\n%s\n' "$(date -Iseconds) ${logentry}."
systemd-cat -t "$called" -p 7 printf '%s' "$logentry"
exit $retc

0 comments on commit 964b7ef

Please sign in to comment.