Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: gentoo-dev@l.g.o
Cc: base-system@g.o
Subject: [gentoo-dev] [PATCH] multiprocessing.eclass: make loadavg regex work for float values
Date: Mon, 11 Sep 2017 03:23:50
Message-Id: 20170911032340.2758-1-floppym@gentoo.org
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 50368e35ea93..029201779957 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]+)*).*:\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}}
-- 
2.14.1

Replies