[[ ${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:
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
# 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"
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
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