Skip to content

Commit 3987ecc

Browse files
committed
sys-apps/portage-3.0.72: avoid assigning reserved variables
PORTAGE_GID is a read-only Portage var Signed-off-by: Fabian Groffen <[email protected]>
1 parent 044a7d7 commit 3987ecc

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

sys-apps/portage/portage-3.0.72.ebuild

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,16 @@ src_prepare() {
126126
-i cnf/repos.conf || die "sed failed"
127127

128128
# PREFIX LOCAL: do the work of configure with expansions here
129-
PORTAGE_GROUP=${PORTAGE_GRPNAME}
130-
PORTAGE_USER=${PORTAGE_USERNAME}
131-
[[ -z ${PORTAGE_GROUP} ]] && \
132-
PORTAGE_GROUP=$(python -c 'from portage.const import portagegroup; print(portagegroup)')
133-
[[ -z ${PORTAGE_USER} ]] && \
134-
PORTAGE_USER=$(python -c 'from portage.const import portageuser; print(portageuser)')
135-
[[ -z ${PORTAGE_GROUP} ]] && PORTAGE_GROUP=portage
136-
[[ -z ${PORTAGE_USER} ]] && PORTAGE_USER=portage
137-
PORTAGE_GID=$(python -c "import grp; print(grp.getgrnam('${PORTAGE_GROUP}').gr_gid)")
138-
PORTAGE_UID=$(id -u ${PORTAGE_USER})
129+
P_GROUP=${PORTAGE_GRPNAME}
130+
P_USER=${PORTAGE_USERNAME}
131+
[[ -z ${P_GROUP} ]] && \
132+
P_GROUP=$(python -c 'from portage.const import portagegroup; print(portagegroup)')
133+
[[ -z ${P_USER} ]] && \
134+
P_USER=$(python -c 'from portage.const import portageuser; print(portageuser)')
135+
[[ -z ${P_GROUP} ]] && P_GROUP=portage
136+
[[ -z ${P_USER} ]] && P_USER=portage
137+
P_GID=$(python -c "import grp; print(grp.getgrnam('${P_GROUP}').gr_gid)")
138+
P_UID=$(id -u ${P_USER})
139139

140140
# We need to probe for bash in the Prefix, because it may not
141141
# exist, in which case we fall back to the currently in use
@@ -148,10 +148,10 @@ src_prepare() {
148148
sed -e "s|@PORTAGE_EPREFIX@|${EPREFIX}|" \
149149
-e "s|@PORTAGE_MV@|$(type -P mv)|" \
150150
-e "s|@PORTAGE_BASH@|${bash}|" \
151-
-e "s|@portagegroup@|${PORTAGE_GROUP}|" \
152-
-e "s|@portageuser@|${PORTAGE_USER}|" \
153-
-e "s|@rootuid@|${PORTAGE_UID}|" \
154-
-e "s|@rootgid@|${PORTAGE_GID}|" \
151+
-e "s|@portagegroup@|${P_GROUP}|" \
152+
-e "s|@portageuser@|${P_USER}|" \
153+
-e "s|@rootuid@|${P_UID}|" \
154+
-e "s|@rootgid@|${P_GID}|" \
155155
-e "s|@sysconfdir@|${EPREFIX}/etc|" \
156156
-i \
157157
lib/portage/const_autotool.py cnf/make.globals \

0 commit comments

Comments
 (0)