epatch.eclass: drop 'estack.eclass' usage
authorSergei Trofimovich <slyfox@gentoo.org>
Fri, 10 Aug 2018 23:46:23 +0000 (00:46 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 18 Aug 2018 23:28:04 +0000 (00:28 +0100)
Avoid use of eshopts_push / eshopts_pop functions
as they don't preserve expand_aliases shell option
and get detected by QA warning as:
  * QA Notice: Global shell options changed and were
  not restored while calling 'src_prepare'

Ssee bug #662586 for details.

Tested as:
    $ EPATCH_USER_EXCLUDE="*" ebuild gcc-8.2.0.ebuild clean prepare

Bug: https://bugs.gentoo.org/662586
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/epatch.eclass

index da93641367772f1ffbf761a66f01e33ead8136b0..1ea657a3b6f8ab35c0aa19e212140355957d17d9 100644 (file)
@@ -19,8 +19,6 @@ 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.
@@ -211,13 +209,14 @@ epatch() {
                # Let people filter things dynamically
                if [[ -n ${EPATCH_EXCLUDE}${EPATCH_USER_EXCLUDE} ]] ; then
                        # let people use globs in the exclude
-                       eshopts_push -o noglob
+                       local prev_noglob=$(shopt -p -o noglob)
+                       set -o noglob
 
                        local ex
                        for ex in ${EPATCH_EXCLUDE} ; do
                                if [[ ${patchname} == ${ex} ]] ; then
                                        einfo "  Skipping ${patchname} due to EPATCH_EXCLUDE ..."
-                                       eshopts_pop
+                                       ${prev_noglob}
                                        continue 2
                                fi
                        done
@@ -225,12 +224,12 @@ epatch() {
                        for ex in ${EPATCH_USER_EXCLUDE} ; do
                                if [[ ${patchname} == ${ex} ]] ; then
                                        einfo "  Skipping ${patchname} due to EPATCH_USER_EXCLUDE ..."
-                                       eshopts_pop
+                                       ${prev_noglob}
                                        continue 2
                                fi
                        done
 
-                       eshopts_pop
+                       ${prev_noglob}
                fi
 
                if [[ ${SINGLE_PATCH} == "yes" ]] ; then