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 78E34158064 for ; Mon, 13 May 2024 13:22:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0C81FE2A56; Mon, 13 May 2024 13:22:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 EAC0EE2A56 for ; Mon, 13 May 2024 13:22:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1CFCF3406D1 for ; Mon, 13 May 2024 13:22:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7B6431AAB for ; Mon, 13 May 2024 13:22:15 +0000 (UTC) From: "Michael Orlitzky" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" Message-ID: <1715606007.bd3da28e258a68566d1abe18aa6713594adcd0ff.mjo@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/acct-group.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mjo X-VCS-Committer-Name: Michael Orlitzky X-VCS-Revision: bd3da28e258a68566d1abe18aa6713594adcd0ff X-VCS-Branch: master Date: Mon, 13 May 2024 13:22:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 57997c29-3f24-44b3-94c1-99f92bf7c536 X-Archives-Hash: 8a29228dfc7c7cf963766f8922af52ac commit: bd3da28e258a68566d1abe18aa6713594adcd0ff Author: Michael Orlitzky gentoo org> AuthorDate: Thu May 9 20:17:12 2024 +0000 Commit: Michael Orlitzky gentoo org> CommitDate: Mon May 13 13:13:27 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd3da28e eclass/acct-group.eclass: use $PN to construct make.conf override vars If (after upcasing and replacing hyphens by underscores) ACCT_GROUP_NAME is set to something that isn't valid in a bash variable name, the eclass will crash: it uses ACCT_GROUP_NAME to construct the make.conf override variables in pkg_pretend() and src_install(). This commit constructs the variable names using PN instead of ACCT_GROUP_NAME. In ::gentoo, the two are equivalent, but in an overlay this allows weirder group names at the expense of slightly mismatched variable names. Signed-off-by: Michael Orlitzky gentoo.org> eclass/acct-group.eclass | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass index 6dd6dc06a07e..2c2c88cfc7e1 100644 --- a/eclass/acct-group.eclass +++ b/eclass/acct-group.eclass @@ -96,8 +96,9 @@ acct-group_pkg_pretend() { [[ ${ACCT_GROUP_ID} -ge -1 ]] || die "Ebuild error: ACCT_GROUP_ID=${ACCT_GROUP_ID} invalid!" local group_id=${ACCT_GROUP_ID} - # check for the override - local override_name=${ACCT_GROUP_NAME^^} + # check for the override, use PN in case this is an overlay and + # ACCT_GROUP_NAME is not PN and not valid in a bash variable name + local override_name=${PN^^} local override_var=ACCT_GROUP_${override_name//-/_}_ID if [[ -n ${!override_var} ]]; then group_id=${!override_var} @@ -132,8 +133,9 @@ acct-group_pkg_pretend() { acct-group_src_install() { debug-print-function ${FUNCNAME} "${@}" - # check for the override - local override_name=${ACCT_GROUP_NAME^^} + # check for the override, use PN in case this is an overlay and + # ACCT_GROUP_NAME is not PN and not valid in a bash variable name + local override_name=${PN^^} local override_var=ACCT_GROUP_${override_name//-/_}_ID if [[ -n ${!override_var} ]]; then ewarn "${override_var}=${!override_var} override in effect, support will not be provided."