commit:     ce0201b96643e66f98d76fbb7838f32e510c2954
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  2 07:30:58 2025 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Dec  2 07:30:58 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ce0201b9

sys-apps/portage: rootuser has disappeared, use portage instead

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

 sys-apps/portage/portage-3.0.72.ebuild | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/sys-apps/portage/portage-3.0.72.ebuild 
b/sys-apps/portage/portage-3.0.72.ebuild
index 5d1000df01..11e34a547d 100644
--- a/sys-apps/portage/portage-3.0.72.ebuild
+++ b/sys-apps/portage/portage-3.0.72.ebuild
@@ -125,17 +125,17 @@ src_prepare() {
                        -e "s|^\(sync-uri = 
\).*|\\1rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix|" \
                        -i cnf/repos.conf || die "sed failed"
 
-               # PREFIX LOCAL: only hack const_autotool
+               # PREFIX LOCAL: do the work of configure with expansions here
                PORTAGE_GROUP=${PORTAGE_GRPNAME}
                PORTAGE_USER=${PORTAGE_USERNAME}
-               PORTAGE_ROOT_USER=$(python -c 'from portage.const import 
rootuser; print(rootuser)')
                [[ -z ${PORTAGE_GROUP} ]] && \
                        PORTAGE_GROUP=$(python -c 'from portage.const import 
portagegroup; print(portagegroup)')
                [[ -z ${PORTAGE_USER} ]] && \
                        PORTAGE_USER=$(python -c 'from portage.const import 
portageuser; print(portageuser)')
-               [[ -z ${PORTAGE_ROOT_USER} ]] && PORTAGE_ROOT_USER=root
                [[ -z ${PORTAGE_GROUP}     ]] && PORTAGE_GROUP=portage
                [[ -z ${PORTAGE_USER}      ]] && PORTAGE_USER=portage
+               PORTAGE_GID=$(python -c "import grp; 
print(grp.getgrnam('${PORTAGE_GROUP}').gr_gid)")
+               PORTAGE_UID=$(id -u ${PORTAGE_USER})
 
                # We need to probe for bash in the Prefix, because it may not
                # exist, in which case we fall back to the currently in use
@@ -150,20 +150,19 @@ src_prepare() {
                        -e "s|@PORTAGE_BASH@|${bash}|" \
                        -e "s|@portagegroup@|${PORTAGE_GROUP}|" \
                        -e "s|@portageuser@|${PORTAGE_USER}|" \
-                       -e "s|@rootuser@|${PORTAGE_ROOT_USER}|" \
-                       -e "s|@rootuid@|$(id -u ${PORTAGE_ROOT_USER})|" \
-                       -e "s|@rootgid@|$(id -g ${PORTAGE_ROOT_USER})|" \
+                       -e "s|@rootuid@|${PORTAGE_UID}|" \
+                       -e "s|@rootgid@|${PORTAGE_GID}|" \
                        -e "s|@sysconfdir@|${EPREFIX}/etc|" \
-                       -e "s|@portageuser@|${PORTAGE_USER}|" \
-                       -e "s|@portagegroup@|${PORTAGE_GROUP}|" \
                        -i \
                        lib/portage/const_autotool.py cnf/make.globals \
                        || die "Failed to patch sources"
 
                sed -e "s|@PREFIX_PORTAGE_PYTHON@|$(type -P python)|" \
                        -i \
-                       bin/ebuild-helpers/dohtml bin/ebuild-pyhelper \
-                       bin/misc-functions.sh bin/phase-functions.sh \
+                       bin/ebuild-helpers/dohtml \
+                       bin/ebuild-pyhelper \
+                       bin/misc-functions.sh \
+                       bin/phase-functions.sh \
                        || die "Failed to patch sources"
 
                # remove Makefiles, or else they will get installed

Reply via email to