From 27432830c2e4ea6aec15ff90a0655b76727ab43b Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 21 Dec 2021 09:55:15 +0100 Subject: [PATCH] eclass/epatch: Sync with gentoo It's from gentoo commit 7a9020ea8b355ffdb03d4f9f7d7328b1e985f25b. --- .../portage-stable/eclass/epatch.eclass | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sdk_container/src/third_party/portage-stable/eclass/epatch.eclass b/sdk_container/src/third_party/portage-stable/eclass/epatch.eclass index 1ea657a3b6..5d18befe55 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/epatch.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/epatch.eclass @@ -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 @@ -292,7 +294,7 @@ epatch() { local rel_paths=$(egrep -n '^[-+]{3} [^ ]*[.][.]/' "${PATCH_TARGET}") if [[ -n ${rel_paths} ]] ; then echo - eerror "Rejected Patch: ${patchname} !" + eerror "Rejected Patch: ${patchname}!" eerror " ( ${PATCH_TARGET} )" eerror eerror "Your patch uses relative paths '../':" @@ -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 bugreport the contents of:" + 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.