Skip to content

Commit

Permalink
multiprocessing.eclass: make loadavg regex work for float values
Browse files Browse the repository at this point in the history
  • Loading branch information
floppym committed Sep 14, 2017
1 parent 6817c96 commit 3fd2a35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eclass/multiprocessing.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ makeopts_loadavg() {
# This assumes the first .* will be more greedy than the second .*
# since POSIX doesn't specify a non-greedy match (i.e. ".*?").
local lavg=$(echo " $* " | sed -r -n \
-e 's:.*[[:space:]](-[a-z]*l|--(load-average|max-load)[=[:space:]])[[:space:]]*([0-9]+|[0-9]+\.[0-9]+).*:\3:p' \
-e 's:.*[[:space:]](-[a-z]*l|--(load-average|max-load)[=[:space:]])[[:space:]]*([0-9]+(\.[0-9]+)?)[[:space:]].*:\3:p' \
-e "s:.*[[:space:]](-[a-z]*l|--(load-average|max-load))[[:space:]].*:${2:-999}:p")
# Default to ${inf} since the default is to not use a load limit.
echo ${lavg:-${2:-999}}
Expand Down

0 comments on commit 3fd2a35

Please sign in to comment.