commit:     429889525e2179b69aef6d728003c0ebc54a5d28
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 16 19:21:37 2025 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Dec 16 19:21:37 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=42988952

sys-apps/portage-3.0.73: version bump

This version migrates user settings from make.globals to make.conf, it
is essential that this completes for portage to be able to function
after upgrading to this version.  Should it somehow fail, then the
following variables need to be added to make.conf with the appropriate
values:

    PORTAGE_USERNAME
    PORTAGE_GRPNAME
    PORTAGE_INST_UID
    PORTAGE_INST_GID

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

 sys-apps/portage/Manifest                          |  1 +
 ...portage-3.0.62.ebuild => portage-3.0.73.ebuild} | 89 ++++++++++++++--------
 2 files changed, 57 insertions(+), 33 deletions(-)

diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
index 931d367a99..0cbd4235ce 100644
--- a/sys-apps/portage/Manifest
+++ b/sys-apps/portage/Manifest
@@ -1,3 +1,4 @@
 DIST prefix-portage-3.0.62.tar.bz2 1540010 BLAKE2B 
5228459672b9928881fcce58b01c30af4974cf56c5227f6b9a83ae14579821a65b5914a2c538ce3a2e6805a2abde226fb4a9c6b8fb4c8035a5b8a931e813e5b9
 SHA512 
07bb343c243ada777dd606318b49fb76b436c189d02f086ce069d6a1dbb4ce9fe5539b26c8bb0bb223ea981acaa92397ec43b21a669a8fcea89b4f4fc94d0b1d
 DIST prefix-portage-3.0.63.tar.bz2 1501121 BLAKE2B 
4d9ec570e958dca53b8adf7057d2f2b88083bfd7570b75594d54513e7bb3a4641b7d1f4b87689a863e092215f764f8609d53bc8becdbdb91108b9801a8ccc1ca
 SHA512 
df63d040d91912d81dbc15373618e6b2c043641bd93afd035c3739999c38d2616d3dcc87591e45eceeed17095ccddef90502684460e20f73ee451aa65bdac761
 DIST prefix-portage-3.0.72.tar.bz2 1533963 BLAKE2B 
3e97a868841819d3ac96efdb16fc1e09f3d25c3640971e9844fe34b677c162d0afcd4d8f8cfb51a047b161154153804414cb9eba38fd9b1a31750a99c7da6c5b
 SHA512 
50b145d4c6f10c3b0d00fa9b0bbf8cbb1fb6e6a1b33bfbf2df498de287aa76da477302b27b997f6c23aefe6a7f154539fb47c9a25b1e86a71d7b8e22bb973d6d
+DIST prefix-portage-3.0.73.tar.bz2 1546048 BLAKE2B 
990a442ce67c669a55cec73817dedf83fd420ac582bc1572609341545217be06a12192f7b48ce112a62a3093c8a27a521c73df3e9d2e51be95bd5e3accab1052
 SHA512 
9173d0fe8112ee52b4893550adf07896a5b1d2848736b78a769df08e8cf093d94e3f4a7cc76f2b8b1b32a671f03be3422797c9a2267977db271e0225a8aa16bd

diff --git a/sys-apps/portage/portage-3.0.62.ebuild 
b/sys-apps/portage/portage-3.0.73.ebuild
similarity index 79%
rename from sys-apps/portage/portage-3.0.62.ebuild
rename to sys-apps/portage/portage-3.0.73.ebuild
index 7f20a5531f..f29a01d676 100644
--- a/sys-apps/portage/portage-3.0.62.ebuild
+++ b/sys-apps/portage/portage-3.0.73.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-PYTHON_COMPAT=( pypy3 python3_{10..12} )
+PYTHON_COMPAT=( pypy3 python3_{10..13} )
 PYTHON_REQ_USE='bzip2(+),threads(+)'
 TMPFILES_OPTIONAL=1
 
@@ -125,38 +125,13 @@ 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
-               # ok, we can't rely on PORTAGE_ROOT_USER being there yet, as 
people
-               # tend not to update that often, as long as we are a separate 
ebuild
-               # we can assume when unset, it's time for some older trick
-               if [[ -z ${PORTAGE_ROOT_USER} ]] ; then
-                       PORTAGE_ROOT_USER=$(python -c 'from portage.const 
import rootuser; print rootuser')
-               fi
-               # 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
-               # bash.  This logic is necessary in particular during bootstrap,
-               # where we pull ourselves out of a temporary place with tools
-               local bash="${EPREFIX}/bin/bash"
-               [[ ! -x ${bash} ]] && bash=${BASH}
-
-               einfo "Adjusting sources for ${EPREFIX}"
-               sed -e "s|@PORTAGE_EPREFIX@|${EPREFIX}|" \
-                       -e "s|@PORTAGE_MV@|$(type -P mv)|" \
-                       -e "s|@PORTAGE_BASH@|${bash}|" \
-                       -e "s|@portagegroup@|${PORTAGE_GROUP:-portage}|" \
-                       -e "s|@portageuser@|${PORTAGE_USER:-portage}|" \
-                       -e "s|@rootuser@|${PORTAGE_ROOT_USER:-root}|" \
-                       -e "s|@rootuid@|$(id -u ${PORTAGE_ROOT_USER:-root})|" \
-                       -e "s|@rootgid@|$(id -g ${PORTAGE_ROOT_USER:-root})|" \
-                       -e "s|@sysconfdir@|${EPREFIX}/etc|" \
-                       -i \
-                       lib/portage/const_autotool.py cnf/make.globals \
-                       || die "Failed to patch sources"
-
+               # PREFIX LOCAL: do the work of configure with expansions here
                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
@@ -299,4 +274,52 @@ pkg_postinst() {
                eerror "Please remove this from ${bashrc} to avoid problems."
                eerror "See bug 867010 for more details."
        fi
+
+       # migrate to setup where user/group are in the users' config
+       if use prefix-guest; then
+               python_setup
+
+               local P_USER=$(
+                       env -u PORTAGE_USERNAME \
+                               "${PYTHON}" -c 'from portage.data import 
_portage_username; print(_portage_username)')
+               if [[ ${P_USER} != ${PORTAGE_USERNAME} ]] ; then
+                       elog "Your Portage configuration is incomplete."
+                       elog "Due to a change in how Prefix Portage handles 
user and group"
+                       elog "administration, you must add the following in 
your"
+                       elog "  ${EROOT}/etc/portage/make.conf"
+                       elog "PORTAGE_USERNAME=\"${PORTAGE_USERNAME}\""
+                       elog "PORTAGE_GRPNAME=\"${PORTAGE_GRPNAME}\""
+                       elog "PORTAGE_INST_UID=\"${PORTAGE_INST_UID}\""
+                       elog "PORTAGE_INST_GID=\"${PORTAGE_INST_GID}\""
+                       eerror "your installation will break without these 
settings"
+
+                       local conffile="${EROOT}/etc/portage/make.conf"
+                       if [[ -d ${conffile} ]] ; then
+                               local f
+                               for f in ${conffile}/* ; do
+                                       if [[ -w ${f} ]] ; then
+                                               conffile=${f}
+                                               break;
+                                       fi
+                               done
+                       fi
+                       if [[ ! -w ${conffile} ]] ; then
+                               eerror "could not find a file in your make.conf 
to write to"
+                               eerror "you must add the variables yourself!"
+                       else
+                               {
+                                       echo ""
+                                       echo "# added by ${P} at $(date)"
+                                       echo "# this was done as part of a 
migration of these"
+                                       echo "# values from make.globals to 
user configuration"
+                                       echo 
"PORTAGE_USERNAME=\"${PORTAGE_USERNAME}\""
+                                       echo 
"PORTAGE_GRPNAME=\"${PORTAGE_GRPNAME}\""
+                                       echo 
"PORTAGE_INST_UID=\"${PORTAGE_INST_UID}\""
+                                       echo 
"PORTAGE_INST_GID=\"${PORTAGE_INST_GID}\""
+                               } >> "${conffile}"
+                               elog "user configuration variables were 
automatically added"
+                               elog "to your ${conffile}, please review"
+                       fi
+               fi
+       fi
 }

Reply via email to