From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BEDB615800A for ; Mon, 24 Jul 2023 18:58:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 44350E0891; Mon, 24 Jul 2023 18:58:12 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 058A9E086C for ; Mon, 24 Jul 2023 18:58:12 +0000 (UTC) From: Florian Schmaus To: gentoo-dev@lists.gentoo.org Cc: Florian Schmaus Subject: [gentoo-dev] [PATCH 1/3] multiprocessing.eclass: search also GNUMAKEFLAGS for --load-average Date: Mon, 24 Jul 2023 20:57:58 +0200 Message-ID: <20230724185800.288216-1-flow@gentoo.org> X-Mailer: git-send-email 2.41.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: b08b3452-363d-4ff5-b00d-a1ea928ef730 X-Archives-Hash: 8bea1bb5357f4a4f9ee75e6ca5851e4a Since --load-average may not be found in other Make implementations besides GNU MAKE, it is potentially found in GNUMAKEFLAGS and not in MAKEOPTS. Signed-off-by: Florian Schmaus --- eclass/multiprocessing.eclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.eclass index e55be636a02c..6489ecbb44a6 100644 --- a/eclass/multiprocessing.eclass +++ b/eclass/multiprocessing.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: multiprocessing.eclass @@ -86,7 +86,7 @@ makeopts_jobs() { # @FUNCTION: makeopts_loadavg # @USAGE: [${MAKEOPTS}] [${inf:-999}] # @DESCRIPTION: -# Searches the arguments (defaults to ${MAKEOPTS}) and extracts the value set +# Searches the arguments (defaults to ${MAKEOPTS} ${GNUMAKEFLAGS}) and extracts the value set # for load-average. For make and ninja based builds this will mean new jobs are # not only limited by the jobs-value, but also by the current load - which might # get excessive due to I/O and not just due to CPU load. @@ -95,7 +95,7 @@ makeopts_jobs() { # If no limit is specified or --load-average is used without a number, ${inf} # (defaults to 999) is returned. makeopts_loadavg() { - [[ $# -eq 0 ]] && set -- "${MAKEOPTS}" + [[ $# -eq 0 ]] && set -- "${MAKEOPTS} ${GNUMAKEFLAGS}" # 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 \ -- 2.41.0