Skip to content

Commit

Permalink
Fixed for newer make versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hader committed Feb 21, 2024
1 parent 7b1d0ee commit bba1dd3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/regress/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,18 @@ job_count=1
if [ -n "$parallel_tool" ]; then
if [[ -n "$j_option" ]]; then
job_count=0
elif [[ "$MAKEFLAGS" == *"jobserver-fds="* ]] || [[ "$MAKEFLAGS" == *"jobserver-auth="* ]]; then
elif [[ "$MAKEFLAGS" =~ --jobserver-(fds\|auth)=([0-9]+),([0-9]+) ]]; then
# greedy get as many tokens as possible
fdR=$(echo "$MAKEFLAGS" | sed -E "s|.*--jobserver-(fds\|auth)=([0-9]+),([0-9]+).*|\2|")
fdW=$(echo "$MAKEFLAGS" | sed -E "s|.*--jobserver-(fds\|auth)=([0-9]+),([0-9]+).*|\3|")
while IFS= read -r -d '' -t 1 -n 1 <&"$fdR"; do
job_count=$((job_count+1))
done
elif [[ "$MAKEFLAGS" =~ --jobserver-auth=fifo:([^ ]+) ]]; then
fifo=$(echo "$MAKEFLAGS" | sed -E "s|.*--jobserver-auth=fifo:([^ ]+).*|\1|")
while IFS= read -r -d '' -t 1 -n 1 <"$fifo"; do
job_count=$((job_count+1))
done
elif [[ "$MAKEFLAGS" =~ (^|[ ])-?j($|[ ]) ]]; then
job_count=0
fi
Expand All @@ -162,8 +167,9 @@ esac

# give back tokens
while [[ $job_count -gt 1 ]]; do
echo -n '+' >&"$fdW"
job_count=$((job_count-1))
[[ -n $fdW ]] && echo -n '+' >&"$fdW"
[[ -n $fifo ]] && echo -n '+' >"$fifo"
job_count=$((job_count-1))
done

pass=$(find "$logdir" -type f -name "*.pass" | wc -l)
Expand Down

0 comments on commit bba1dd3

Please sign in to comment.