commit:     6c2d1ab6ffdf2480ec64c77d2e1c4e99565f3233
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  2 07:37:29 2025 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Dec  2 07:40:44 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6c2d1ab6

autoconf: drop notion of rootuser

There is no real point to this any more, an unprivileged install uses
the only user there is, a privileged install will unset PORTAGE_INST_*
and default to root/wheel.

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

 cnf/make.globals |  2 +-
 configure.ac     | 23 +++++++----------------
 subst-install.in |  3 ---
 3 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/cnf/make.globals b/cnf/make.globals
index 18eb2a61f3..50ced14c38 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -156,7 +156,7 @@ PORTAGE_WORKDIR_MODE="0700"
 PORTAGE_ELOG_CLASSES="log warn error"
 PORTAGE_ELOG_SYSTEM="save_summary:log,warn,error,qa echo"
 
-PORTAGE_ELOG_MAILURI="@rootuser@"
+PORTAGE_ELOG_MAILURI="@portageuser@"
 PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"
 PORTAGE_ELOG_MAILFROM="@portageuser@@localhost"
 # END PREFIX LOCAL

diff --git a/configure.ac b/configure.ac
index 12b669efb3..3442bbd7bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,30 +61,22 @@ AS_HELP_STRING([--with-portage-group=mygroup],[use group 
'mygroup' as portage us
 esac],
 [portagegroup="portage"])
 
-AC_ARG_WITH(root-user,
-AS_HELP_STRING([--with-root-user=myuser],[uses 'myuser' as owner of installed 
files (default is portage-user)]),
-[case "${withval}" in
-  ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-root-user);;
-  *) rootuser="${withval}";;
-esac],
-[rootuser="${portageuser}"])
-
-AC_MSG_CHECKING([for user id of ${rootuser}])
-dnl grab uid of rootuser
-rootuid=`${XCU_ID} -u "${rootuser}"`
+AC_MSG_CHECKING([for user id of ${portageuser}])
+dnl grab uid of portageuser
+rootuid=`${XCU_ID} -u "${portageuser}"`
 if test "x`echo ${rootuid} | ${EGREP} '^[[0-9]]+$'`" != "x"
 then
        AC_MSG_RESULT([${rootuid}])
 else
-       AC_MSG_ERROR([error finding the user id of ${rootuser}])
+       AC_MSG_ERROR([error finding the user id of ${portageuser}])
 fi
-AC_MSG_CHECKING([for group id of ${rootuser}])
-rootgid=`${XCU_ID} -g "${rootuser}"`
+AC_MSG_CHECKING([for group id of ${portagegroup}])
+rootgid=`${PREFIX_PORTAGE_PYTHON} -c "import grp; 
print(grp.getgrnam('${portagegroup}').gr_gid)"`
 if test "x`echo ${rootgid} | ${EGREP} '^[[0-9]]+$'`" != "x"
 then
        AC_MSG_RESULT([${rootgid}])
 else
-       AC_MSG_ERROR([error finding the group id of ${rootuser}])
+       AC_MSG_ERROR([error finding the group id of ${portagegroup}])
 fi
 
 AC_ARG_WITH(offset-prefix, 
@@ -99,7 +91,6 @@ fi
 
 AC_SUBST(portageuser)
 AC_SUBST(portagegroup)
-AC_SUBST(rootuser)
 AC_SUBST(rootuid)
 AC_SUBST(rootgid)
 AC_SUBST(PORTAGE_EPREFIX)

diff --git a/subst-install.in b/subst-install.in
index 07576eede7..1bad6165f1 100644
--- a/subst-install.in
+++ b/subst-install.in
@@ -9,10 +9,8 @@ exec_prefix="@exec_prefix@"
 # be a backreference) and hence escape those.  Eventually in strings we
 # need to escape the backslash too, such that the single backslash
 # doesn't get lost when considered an invalid escape
-rootuser='@rootuser@'
 portagegroup='@portagegroup@'
 portageuser='@portageuser@'
-rootuser=${rootuser//\\/\\\\}
 portagegroup=${portagegroup//\\/\\\\\\\\}
 portageuser=${portageuser//\\/\\\\\\\\}
 
@@ -35,7 +33,6 @@ sedexp=(
        -e "s,${at}portageuser${at},${portageuser},g"
        -e "s,${at}rootgid${at},@rootgid@,g"
        -e "s,${at}rootuid${at},@rootuid@,g"
-       -e "s,${at}rootuser${at},${rootuser},g"
        -e "s,${at}sysconfdir${at},@sysconfdir@,g"
 )
 

Reply via email to