summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2017-09-10 23:18:56 -0400
committerMike Gilbert <floppym@gentoo.org>2017-09-14 15:05:32 -0400
commit3fd2a3508a16643cef428f7a49e3ee37bee3b494 (patch)
tree6a522fffdbe91dd2e6581ffa2f4f7bfa0ecafe2e /eclass/multiprocessing.eclass
parentsys-devel/binutils: Restore keywords for 2.29 (diff)
downloadgentoo-3fd2a3508a16643cef428f7a49e3ee37bee3b494.tar.gz
gentoo-3fd2a3508a16643cef428f7a49e3ee37bee3b494.tar.bz2
gentoo-3fd2a3508a16643cef428f7a49e3ee37bee3b494.zip
multiprocessing.eclass: make loadavg regex work for float values
Bug: https://bugs.gentoo.org/630626
Diffstat (limited to 'eclass/multiprocessing.eclass')
-rw-r--r--eclass/multiprocessing.eclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.eclass
index 50368e35ea93..b6e92976f73e 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}}