Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ban non-PMS helpers #1138

Merged
merged 5 commits into from Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS
Expand Up @@ -3,6 +3,10 @@ portage-3.0.54 (UNRELEASED)

TODO

Breaking changes:
* Finally ban non-PMS helpers portageq, prepinfo, prepman, prepstrip and
prepallstrip (bug #899898, bug #906129, bug #906156).

portage-3.0.53 (2023-10-20)
--------------

Expand Down
4 changes: 2 additions & 2 deletions bin/ebuild-helpers/portageq
Expand Up @@ -4,5 +4,5 @@

source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1

eqawarn "QA Notice: '${0##*/}' is not allowed in ebuild scope"
exec "${PORTAGE_BIN_PATH}"/portageq-wrapper "$@"
die "'${0##*/}' is not allowed in ebuild scope"
exit 1
13 changes: 2 additions & 11 deletions bin/ebuild-helpers/prepallstrip
Expand Up @@ -4,14 +4,5 @@

source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1

if ___eapi_has_dostrip; then
die "${0##*/}: ${0##*/} has been banned for EAPI '${EAPI}'; use 'dostrip' instead"
fi

eqawarn "QA Notice: '${0##*/}' is not allowed in ebuild scope"

if ! ___eapi_has_prefix_variables; then
ED=${D}
fi

exec prepstrip "${ED}"
die "'${0##*/}' is not allowed in ebuild scope"
exit 1
36 changes: 2 additions & 34 deletions bin/ebuild-helpers/prepinfo
Expand Up @@ -4,37 +4,5 @@

source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1

eqawarn "QA Notice: '${0##*/}' is not allowed in ebuild scope"

if ! ___eapi_has_prefix_variables ; then
ED=${D}
fi

if [[ -z ${1} ]] ; then
infodir="/usr/share/info"
else
if [[ -d ${ED%/}/${1#/}/share/info ]] ; then
infodir="${1#/}/share/info"
else
infodir="${1#/}/info"
fi
fi

if [[ ! -d ${ED%/}/${infodir#/} ]] ; then
if [[ -n $1 ]] ; then
__vecho "${0##*/}: '${infodir}' does not exist!"
exit 1
else
exit 0
fi
fi

find "${ED%/}/${infodir#/}" -type d -print0 | while read -r -d $'\0' x ; do
for f in "${x}"/.keepinfodir*; do
[[ -e ${f} ]] && continue 2
done

rm -f "${x}"/dir{,.info}{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst}
done

exit 0
die "'${0##*/}' is not allowed in ebuild scope"
exit 1
8 changes: 2 additions & 6 deletions bin/ebuild-helpers/prepman
Expand Up @@ -2,11 +2,7 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Note: this really does nothing these days. It's going to be banned
# when the last consumers are gone.

source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1

eqawarn "QA Notice: '${0##*/}' is not allowed in ebuild scope"

exit 0
die "'${0##*/}' is not allowed in ebuild scope"
exit 1
9 changes: 2 additions & 7 deletions bin/ebuild-helpers/prepstrip
Expand Up @@ -4,10 +4,5 @@

source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1

if ___eapi_has_dostrip; then
die "${0##*/}: ${0##*/} has been banned for EAPI '${EAPI}'; use 'dostrip' instead"
fi

eqawarn "QA Notice: '${0##*/}' is not allowed in ebuild scope"

__PORTAGE_HELPER=prepstrip exec "${PORTAGE_BIN_PATH}"/estrip "${@}"
die "'${0##*/}' is not allowed in ebuild scope"
exit 1
4 changes: 1 addition & 3 deletions bin/estrip
Expand Up @@ -30,9 +30,8 @@ if ${PORTAGE_RESTRICT_strip} || ${FEATURES_nostrip} ; then
${FEATURES_installsources} || exit 0
fi

[[ ${__PORTAGE_HELPER} == prepstrip ]] && prepstrip=true || prepstrip=false
prepstrip=false

if ! ${prepstrip}; then
while [[ $# -gt 0 ]] ; do
case $1 in
--ignore)
Expand Down Expand Up @@ -130,7 +129,6 @@ while [[ $# -gt 0 ]] ; do
shift
done
set -- "${ED}"
fi

PRESERVE_XATTR=false
if [[ ${KERNEL} == linux ]] && ${FEATURES_xattr} ; then
Expand Down
13 changes: 0 additions & 13 deletions bin/misc-functions.sh
Expand Up @@ -147,19 +147,6 @@ install_qa_check() {
# Portage regenerates this on the installed system.
rm -f "${ED%/}"/usr/share/info/dir{,.info}{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst} \
|| die "rm failed"
# Recurse into subdirs. Remove this code after 2023-12-31. #899898
while read -r -d '' x; do
( shopt -s failglob; : "${x}"/.keepinfodir* ) 2>/dev/null \
&& continue
for f in "${x}"/dir{,.info}{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst}; do
if [[ -e ${f} ]]; then
eqawarn "QA Notice: Removing Info directory file '${f}'."
eqawarn "Relying on this behavior is deprecated and may"
eqawarn "cause file collisions in future."
rm -f "${f}" || die "rm failed"
fi
done
done < <(find "${ED%/}"/usr/share/info -mindepth 1 -type d -print0)
fi

# If binpkg-docompress is enabled, apply compression before creating
Expand Down