eclass/epatch: Sync with gentoo

It's from gentoo commit 7a9020ea8b355ffdb03d4f9f7d7328b1e985f25b.
This commit is contained in:
Krzesimir Nowak 2021-12-21 09:55:15 +01:00
parent 5d1d909aee
commit 27432830c2

View File

@ -1,4 +1,4 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: epatch.eclass
@ -6,6 +6,7 @@
# base-system@gentoo.org
# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6
# @BLURB: easy patch application functions
# @DEPRECATED: eapply from EAPI 7
# @DESCRIPTION:
# An eclass providing epatch and epatch_user functions to easily apply
# patches to ebuilds. Mostly superseded by eapply* in EAPI 6.
@ -19,6 +20,8 @@ case ${EAPI:-0} in
die "${ECLASS}: banned in EAPI=${EAPI}; use eapply* instead";;
esac
inherit estack
# @VARIABLE: EPATCH_SOURCE
# @DESCRIPTION:
# Default directory to search for patches.
@ -209,14 +212,13 @@ epatch() {
# Let people filter things dynamically
if [[ -n ${EPATCH_EXCLUDE}${EPATCH_USER_EXCLUDE} ]] ; then
# let people use globs in the exclude
local prev_noglob=$(shopt -p -o noglob)
set -o noglob
eshopts_push -o noglob
local ex
for ex in ${EPATCH_EXCLUDE} ; do
if [[ ${patchname} == ${ex} ]] ; then
einfo " Skipping ${patchname} due to EPATCH_EXCLUDE ..."
${prev_noglob}
eshopts_pop
continue 2
fi
done
@ -224,12 +226,12 @@ epatch() {
for ex in ${EPATCH_USER_EXCLUDE} ; do
if [[ ${patchname} == ${ex} ]] ; then
einfo " Skipping ${patchname} due to EPATCH_USER_EXCLUDE ..."
${prev_noglob}
eshopts_pop
continue 2
fi
done
${prev_noglob}
eshopts_pop
fi
if [[ ${SINGLE_PATCH} == "yes" ]] ; then
@ -357,14 +359,14 @@ epatch() {
if [[ ${count} -ge 5 ]] ; then
echo
eerror "Failed Patch: ${patchname} !"
eerror "Failed patch: ${patchname}!"
eerror " ( ${PATCH_TARGET} )"
eerror
eerror "Include in your bug report the contents of:"
eerror
eerror " ${STDERR_TARGET}"
echo
die "Failed Patch: ${patchname}!"
die "Failed patch: ${patchname}!"
fi
# if everything worked, delete the full debug patch log
@ -387,7 +389,8 @@ epatch() {
case ${EAPI:-0} in
0|1|2|3|4|5)
# @VARIABLE: EPATCH_USER_SOURCE
# @ECLASS_VARIABLE: EPATCH_USER_SOURCE
# @USER_VARIABLE
# @DESCRIPTION:
# Location for user patches, see the epatch_user function.
# Should be set by the user. Don't set this in ebuilds.