If (after upcasing and replacing hyphens by underscores) ACCT_USER_NAME
is set to something that isn't valid in a bash variable name, the eclass
will crash: it uses ACCT_USER_NAME to construct the make.conf override variables in pkg_pretend() and src_install().
This commit relocates the computation of the "override name" subsequent
to the definition of ACCT_USER_NAME="${PN}". In Gentoo, policy prohibits redefinition of that variable; so nothing is changed. But in an overlay,
this allows the ebuild to define ACCT_USER_NAME to something that would
not be valid in a bash variable at the expense of violating expectations
about the override variable names.
Signed-off-by: Michael Orlitzky <
mjo@gentoo.org>
---
eclass/acct-user.eclass | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index a4fe5e9f5e34..fb3ccd2044da 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -64,6 +64,23 @@ inherit user-info
# package naming restrictions would prohibit some otherwise-valid usernames.
ACCT_USER_NAME=${PN}
+# @ECLASS_VARIABLE: _OVERRIDE_NAME
+# @INTERNAL
+# @DESCRIPTION:
+# A version of the user name suitable for use in a bash variable. This
+# is used to construct the names of the make.conf override variables and
+# it will always be uppercase $PN with the hyphens replaced by
+# underscores. It is defined once, here, so that in an overlay the
+# ebuild may set ACCT_USER_NAME to something other than $PN without
+# affecting the name of the override variable. This is necessary if the
+# username in question would lead to an invalid bash variable
+# name. Doing so does violate ex