1 |
commit: cdcebd4db4693bb994dc682b72a3eb593a08e4bf |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 23 00:24:25 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 23 00:24:33 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cdcebd4d |
7 |
|
8 |
eutils.eclass: copy over logic from libtool.eclass to find ELT-patches dir #517752 |
9 |
|
10 |
eclass/eutils.eclass | 16 +++++++++++++++- |
11 |
eclass/libtool.eclass | 7 ++++--- |
12 |
2 files changed, 19 insertions(+), 4 deletions(-) |
13 |
|
14 |
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass |
15 |
index a08aee4..6457501 100644 |
16 |
--- a/eclass/eutils.eclass |
17 |
+++ b/eclass/eutils.eclass |
18 |
@@ -1403,6 +1403,20 @@ built_with_use() { |
19 |
[[ ${opt} = "-a" ]] |
20 |
} |
21 |
|
22 |
+# If an overlay has eclass overrides, but doesn't actually override the |
23 |
+# libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's |
24 |
+# eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So |
25 |
+# add a check to locate the ELT-patches/ regardless of what's going on. |
26 |
+# Note: Duplicated in libtool.eclass. |
27 |
+_EUTILS_ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*} |
28 |
+eutils_elt_patch_dir() { |
29 |
+ local d="${ECLASSDIR}/ELT-patches" |
30 |
+ if [[ ! -d ${d} ]] ; then |
31 |
+ d="${_EUTILS_ECLASSDIR_LOCAL}/ELT-patches" |
32 |
+ fi |
33 |
+ echo "${d}" |
34 |
+} |
35 |
+ |
36 |
# @FUNCTION: epunt_cxx |
37 |
# @USAGE: [dir to scan] |
38 |
# @DESCRIPTION: |
39 |
@@ -1416,7 +1430,7 @@ epunt_cxx() { |
40 |
ebegin "Removing useless C++ checks" |
41 |
local f p any_found |
42 |
while IFS= read -r -d '' f; do |
43 |
- for p in "${PORTDIR}"/eclass/ELT-patches/nocxx/*.patch ; do |
44 |
+ for p in "$(eutils_elt_patch_dir)"/nocxx/*.patch ; do |
45 |
if patch --no-backup-if-mismatch -p1 "${f}" "${p}" >/dev/null ; then |
46 |
any_found=1 |
47 |
break |
48 |
|
49 |
diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass |
50 |
index 090c657..9434480 100644 |
51 |
--- a/eclass/libtool.eclass |
52 |
+++ b/eclass/libtool.eclass |
53 |
@@ -21,8 +21,9 @@ _LIBTOOL_ECLASS=1 |
54 |
# libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's |
55 |
# eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So |
56 |
# add a check to locate the ELT-patches/ regardless of what's going on. |
57 |
+# Note: Duplicated in eutils.eclass. |
58 |
_LIBTOOL_ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*} |
59 |
-elt_patch_dir() { |
60 |
+libtool_elt_patch_dir() { |
61 |
local d="${ECLASSDIR}/ELT-patches" |
62 |
if [[ ! -d ${d} ]] ; then |
63 |
d="${_LIBTOOL_ECLASSDIR_LOCAL}/ELT-patches" |
64 |
@@ -92,7 +93,7 @@ ELT_walk_patches() { |
65 |
local ret=1 |
66 |
local file=$1 |
67 |
local patch_set=$2 |
68 |
- local patch_dir="$(elt_patch_dir)/${patch_set}" |
69 |
+ local patch_dir="$(libtool_elt_patch_dir)/${patch_set}" |
70 |
local rem_int_dep=$3 |
71 |
|
72 |
[[ -z ${patch_set} ]] && return 1 |
73 |
@@ -106,7 +107,7 @@ ELT_walk_patches() { |
74 |
sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" ) |
75 |
fi |
76 |
|
77 |
- pushd "$(elt_patch_dir)" >/dev/null || die |
78 |
+ pushd "$(libtool_elt_patch_dir)" >/dev/null || die |
79 |
|
80 |
# Go through the patches in reverse order (newer version to older) |
81 |
for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do |