eutils.eclass: copy over logic from libtool.eclass to find ELT-patches dir #517752

This commit is contained in:
Mike Frysinger
2015-11-22 19:24:25 -05:00
parent e4872e85b2
commit cdcebd4db4
2 changed files with 19 additions and 4 deletions

View File

@@ -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

View File

@@ -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