commit:     5a37c7cacfdef7eb519e75b3b5affae9199cfcad
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 29 18:21:01 2025 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Jun 29 18:32:22 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a37c7ca

*: drop PORTAGE_GROUP and PORTAGE_USER

Use PORTAGE_GRPNAME and PORTAGE_USERNAME as in main.  This reduces some
local diffs in prefix branch, and now sets the user via make.globals.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 bin/isolated-functions.sh                              |  3 +--
 bin/phase-functions.sh                                 |  3 +--
 bin/save-ebuild-env.sh                                 |  4 ----
 cnf/make.globals                                       |  6 +++---
 lib/portage/const.py                                   |  3 ---
 lib/portage/data.py                                    | 12 +++---------
 lib/portage/package/ebuild/_config/special_env_vars.py |  5 -----
 7 files changed, 8 insertions(+), 28 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 08b21e098c..1ff72a17eb 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -696,8 +696,7 @@ debug-print() {
                printf '%s\n' "${@}" >> "${T}/eclass-debug.log"
 
                # Let the portage user own/write to this file
-               # PREFIX LOCAL: fallback to configured group
-               chgrp "${PORTAGE_GRPNAME:-${PORTAGE_GROUP}}" 
"${T}/eclass-debug.log"
+               chgrp "${PORTAGE_GRPNAME:-portage}" "${T}/eclass-debug.log"
                chmod g+w "${T}/eclass-debug.log"
        fi
 }

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 3652acc0a2..61123cd29d 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1166,8 +1166,7 @@ __ebuild_main() {
                __save_ebuild_env | __filter_readonly_variables \
                        --filter-features > "${T}/environment"
                assert "__save_ebuild_env failed"
-               # PREFIX LOCAL: use configured group
-               chgrp "${PORTAGE_GRPNAME:-${PORTAGE_GROUP}}" "${T}/environment"
+               chgrp "${PORTAGE_GRPNAME:-portage}" "${T}/environment"
                chmod g+w "${T}/environment"
        fi
 

diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index d4160ef0f9..5d5d25bbd7 100755
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -127,10 +127,6 @@ __save_ebuild_env() (
        # user config variables
        unset DOC_SYMLINKS_DIR INSTALL_MASK PKG_INSTALL_MASK
 
-       # PREFIX LOCAL: Prefix additions
-       unset EXTRA_PATH PORTAGE_GROUP PORTAGE_USER
-       # END PREFIX LOCAL
-
        declare -p
        declare -fp
 )

diff --git a/cnf/make.globals b/cnf/make.globals
index adf6aa60aa..b923360d39 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -139,9 +139,8 @@ 
USE_ORDER="env:pkg:conf:defaults:pkginternal:features:repo:env.d"
 
 # PREFIX LOCAL: additional vars set during install
 # Default portage user/group
-PORTAGE_USER='@portageuser@'
-PORTAGE_GROUP='@portagegroup@'
-PORTAGE_ROOT_USER='@rootuser@'
+PORTAGE_USERNAME='@portageuser@'
+PORTAGE_GRPNAME='@portagegroup@'
 
 # Default ownership of installed files.
 PORTAGE_INST_UID="@rootuid@"
@@ -157,6 +156,7 @@ PORTAGE_ELOG_SYSTEM="save_summary:log,warn,error,qa echo"
 PORTAGE_ELOG_MAILURI="@rootuser@"
 PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"
 PORTAGE_ELOG_MAILFROM="@portageuser@@localhost"
+# END PREFIX LOCAL
 
 # Signing command used by egencache
 PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --digest-algo SHA256 --clearsign --yes 
--default-key \"\${PORTAGE_GPG_KEY}\" --homedir \"\${PORTAGE_GPG_DIR}\" 
\"\${FILE}\""

diff --git a/lib/portage/const.py b/lib/portage/const.py
index a770887fe2..d774bfd1a8 100644
--- a/lib/portage/const.py
+++ b/lib/portage/const.py
@@ -121,9 +121,6 @@ MACOSSANDBOX_PROFILE     = '''(version 1)
 @@MACOSSANDBOX_PATHS@@)
 (allow file-write-data
 @@MACOSSANDBOX_PATHS_CONTENT_ONLY@@)'''
-
-PORTAGE_GROUPNAME        = portagegroup
-PORTAGE_USERNAME         = portageuser
 # END PREFIX LOCAL
 
 INVALID_ENV_FILE = "/etc/spork/is/not/valid/profile.env"

diff --git a/lib/portage/data.py b/lib/portage/data.py
index e57e672c36..25096d317f 100644
--- a/lib/portage/data.py
+++ b/lib/portage/data.py
@@ -6,8 +6,6 @@ import grp
 import os
 import platform
 import pwd
-# PREFIX LOCAL
-from portage.const import PORTAGE_GROUPNAME, PORTAGE_USERNAME, EPREFIX
 
 import portage
 from portage.localization import _
@@ -23,7 +21,7 @@ portage.proxy.lazyimport.lazyimport(
 ostype = platform.system()
 userland = "GNU"
 # PREFIX LOCAL: Prefix always has USERLAND=GNU
-if EPREFIX == "" and (ostype == "DragonFly" or ostype.endswith("BSD")):
+if portage.const.EPREFIX == "" and (ostype == "DragonFly" or 
ostype.endswith("BSD")):
     userland = "BSD"
 
 lchown = getattr(os, "lchown", None)
@@ -332,17 +330,13 @@ def _init(settings):
         # from grp.getgrnam() with PyPy
         native_string = platform.python_implementation() == "PyPy"
 
-        # PREFIX LOCAL: use var iso hardwired 'portage'
-        v = settings.get("PORTAGE_GRPNAME", PORTAGE_GROUPNAME)
-        # END PREFIX LOCAL
+        v = settings.get("PORTAGE_GRPNAME", "portage")
         if native_string:
             v = portage._native_string(v)
         globals()["_portage_grpname"] = v
         _initialized_globals.add("_portage_grpname")
 
-        # PREFIX LOCAL: use var iso hardwired 'portage'
-        v = settings.get("PORTAGE_USERNAME", PORTAGE_USERNAME)
-        # END PREFIX LOCAL
+        v = settings.get("PORTAGE_USERNAME", "portage")
         if native_string:
             v = portage._native_string(v)
         globals()["_portage_username"] = v

diff --git a/lib/portage/package/ebuild/_config/special_env_vars.py 
b/lib/portage/package/ebuild/_config/special_env_vars.py
index 4d87e03174..d7b4e29886 100644
--- a/lib/portage/package/ebuild/_config/special_env_vars.py
+++ b/lib/portage/package/ebuild/_config/special_env_vars.py
@@ -243,11 +243,6 @@ environ_whitelist = frozenset(
         "STY",
         "WINDOW",
         "XAUTHORITY",
-        # BEGIN PREFIX LOCAL
-        "EXTRA_PATH",
-        "PORTAGE_GROUP",
-        "PORTAGE_USER",
-        # END PREFIX LOCAL
     )
 )
 

Reply via email to