commit: 3fd2a3508a16643cef428f7a49e3ee37bee3b494 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> AuthorDate: Mon Sep 11 03:18:56 2017 +0000 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> CommitDate: Thu Sep 14 19:05:32 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3fd2a350
multiprocessing.eclass: make loadavg regex work for float values Bug: https://bugs.gentoo.org/630626 eclass/multiprocessing.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.eclass index 50368e35ea9..b6e92976f73 100644 --- a/eclass/multiprocessing.eclass +++ b/eclass/multiprocessing.eclass @@ -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}}