Skip to content

Commit

Permalink
bb: Fallback to other 'log' filenames if it's already taken
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaly Chikunov <[email protected]>
  • Loading branch information
vt-alt committed Jan 17, 2025
1 parent 1159231 commit c97b3f1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bb
Original file line number Diff line number Diff line change
Expand Up @@ -116,31 +116,34 @@ for branch in "${branches[@]}"; do
# Reexport, since we did unset inside of the loop.
export branch set_target

for log in log log1 .log build.log; do
[[ -f "$log" || -d "$log" ]] || break
done
L=.git/bb/log.$(date +%F_%H%M)
[ "sisyphus" = "$branch" ] && unset branch || L+=".$branch"
[ "$HOSTTYPE" = "$set_target" ] && unset set_target || L+=".$set_target"
ln -sf "$L" -T log
ln -sf "$L" -T "$log"

printf '%s' "$sep"
{
set -x
git diff
# shellcheck disable=SC2094
git 'log' -1
} &> log
} &> "$log"
{
{ log_config; } 2>/dev/null
gear-hsh "${commit[@]}" "${@}"
} |& {
{ set +x; } 2>/dev/null
ts %T | tee -a log
ts %T | tee -a "$log"
}
{ set +x; } 2>/dev/null
((${#pkgi[@]})) && (
[ -n "${noinitroot-}" ] || (echo; set -x; hsh --initroot)
echo
pkg_install
) |& ts %T | tee -a log
) |& ts %T | tee -a "$log"
sep=$'\n'
done
done

0 comments on commit c97b3f1

Please sign in to comment.