From cdcebd4db4693bb994dc682b72a3eb593a08e4bf Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 22 Nov 2015 19:24:25 -0500 Subject: [PATCH] eutils.eclass: copy over logic from libtool.eclass to find ELT-patches dir #517752 --- eclass/eutils.eclass | 16 +++++++++++++++- eclass/libtool.eclass | 7 ++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index a08aee40f7ee7..6457501c6b084 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1403,6 +1403,20 @@ built_with_use() { [[ ${opt} = "-a" ]] } +# If an overlay has eclass overrides, but doesn't actually override the +# libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's +# eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So +# add a check to locate the ELT-patches/ regardless of what's going on. +# Note: Duplicated in libtool.eclass. +_EUTILS_ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*} +eutils_elt_patch_dir() { + local d="${ECLASSDIR}/ELT-patches" + if [[ ! -d ${d} ]] ; then + d="${_EUTILS_ECLASSDIR_LOCAL}/ELT-patches" + fi + echo "${d}" +} + # @FUNCTION: epunt_cxx # @USAGE: [dir to scan] # @DESCRIPTION: @@ -1416,7 +1430,7 @@ epunt_cxx() { ebegin "Removing useless C++ checks" local f p any_found while IFS= read -r -d '' f; do - for p in "${PORTDIR}"/eclass/ELT-patches/nocxx/*.patch ; do + for p in "$(eutils_elt_patch_dir)"/nocxx/*.patch ; do if patch --no-backup-if-mismatch -p1 "${f}" "${p}" >/dev/null ; then any_found=1 break diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass index 090c657698306..9434480b25eb0 100644 --- a/eclass/libtool.eclass +++ b/eclass/libtool.eclass @@ -21,8 +21,9 @@ _LIBTOOL_ECLASS=1 # libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's # eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So # add a check to locate the ELT-patches/ regardless of what's going on. +# Note: Duplicated in eutils.eclass. _LIBTOOL_ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*} -elt_patch_dir() { +libtool_elt_patch_dir() { local d="${ECLASSDIR}/ELT-patches" if [[ ! -d ${d} ]] ; then d="${_LIBTOOL_ECLASSDIR_LOCAL}/ELT-patches" @@ -92,7 +93,7 @@ ELT_walk_patches() { local ret=1 local file=$1 local patch_set=$2 - local patch_dir="$(elt_patch_dir)/${patch_set}" + local patch_dir="$(libtool_elt_patch_dir)/${patch_set}" local rem_int_dep=$3 [[ -z ${patch_set} ]] && return 1 @@ -106,7 +107,7 @@ ELT_walk_patches() { sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" ) fi - pushd "$(elt_patch_dir)" >/dev/null || die + pushd "$(libtool_elt_patch_dir)" >/dev/null || die # Go through the patches in reverse order (newer version to older) for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do