1 |
commit: c3e6586e21f32f3da585b7e0ff8ea732c5bd7e66 |
2 |
Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 21 13:20:10 2018 +0000 |
4 |
Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jul 9 16:20:08 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3e6586e |
7 |
|
8 |
toolchain.eclass: EAPI 7 aware for D,ED,ROOT,EROOT |
9 |
|
10 |
These variables may or may not have the trailing slash. Additionally, |
11 |
avoid leading double slash (a network location for Cygwin) with ROOT and |
12 |
EROOT because they may be empty, while D and ED never should be empty |
13 |
and there is no reason so far to avoid double slashes in between. |
14 |
On the other hand, eclass variables like DATAPATH and LIBPATH do contain |
15 |
the leading slash, so an extra slash reduces readability for no reason. |
16 |
|
17 |
eclass/toolchain.eclass | 36 ++++++++++++++++++------------------ |
18 |
1 file changed, 18 insertions(+), 18 deletions(-) |
19 |
|
20 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
21 |
index d80889d1ba6..09d2b7869e1 100644 |
22 |
--- a/eclass/toolchain.eclass |
23 |
+++ b/eclass/toolchain.eclass |
24 |
@@ -1795,13 +1795,13 @@ toolchain_src_install() { |
25 |
|
26 |
cd "${S}" |
27 |
if is_crosscompile; then |
28 |
- rm -rf "${ED}"usr/share/{man,info} |
29 |
+ rm -rf "${ED}"/usr/share/{man,info} |
30 |
rm -rf "${D}"${DATAPATH}/{man,info} |
31 |
else |
32 |
if tc_version_is_at_least 3.0 ; then |
33 |
local cxx_mandir=$(find "${WORKDIR}/build/${CTARGET}/libstdc++-v3" -name man) |
34 |
if [[ -d ${cxx_mandir} ]] ; then |
35 |
- cp -r "${cxx_mandir}"/man? "${D}/${DATAPATH}"/man/ |
36 |
+ cp -r "${cxx_mandir}"/man? "${D}${DATAPATH}"/man/ |
37 |
fi |
38 |
fi |
39 |
has noinfo ${FEATURES} \ |
40 |
@@ -1852,7 +1852,7 @@ toolchain_src_install() { |
41 |
# libvtv.la: gcc itself handles linkage correctly. |
42 |
# lib*san.la: Sanitizer linkage is handled internally by gcc, and they |
43 |
# do not support static linking. #487550 #546700 |
44 |
- find "${D}/${LIBPATH}" \ |
45 |
+ find "${D}${LIBPATH}" \ |
46 |
'(' \ |
47 |
-name libstdc++.la -o \ |
48 |
-name libstdc++fs.la -o \ |
49 |
@@ -1918,7 +1918,7 @@ gcc_movelibs() { |
50 |
# code to run on the target. |
51 |
if tc_version_is_at_least 5 && is_crosscompile ; then |
52 |
dodir "${HOSTLIBPATH#${EPREFIX}}" |
53 |
- mv "${ED}"usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die |
54 |
+ mv "${ED}"/usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die |
55 |
fi |
56 |
|
57 |
# For all the libs that are built for CTARGET, move them into the |
58 |
@@ -2115,7 +2115,7 @@ gcc_slot_java() { |
59 |
|
60 |
toolchain_pkg_postinst() { |
61 |
do_gcc_config |
62 |
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
63 |
+ if [[ ! ${ROOT%/} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
64 |
eselect compiler-shadow update all |
65 |
fi |
66 |
|
67 |
@@ -2130,17 +2130,17 @@ toolchain_pkg_postinst() { |
68 |
echo |
69 |
|
70 |
# Clean up old paths |
71 |
- rm -f "${EROOT}"*/rcscripts/awk/fixlafiles.awk "${EROOT}"sbin/fix_libtool_files.sh |
72 |
- rmdir "${EROOT}"*/rcscripts{/awk,} 2>/dev/null |
73 |
+ rm -f "${EROOT%/}"/*/rcscripts/awk/fixlafiles.awk "${EROOT%/}"/sbin/fix_libtool_files.sh |
74 |
+ rmdir "${EROOT%/}"/*/rcscripts{/awk,} 2>/dev/null |
75 |
|
76 |
- mkdir -p "${EROOT}"usr/{share/gcc-data,sbin,bin} |
77 |
+ mkdir -p "${EROOT%/}"/usr/{share/gcc-data,sbin,bin} |
78 |
# DATAPATH has EPREFIX already, use ROOT with it |
79 |
- cp "${ROOT}${DATAPATH}"/fixlafiles.awk "${EROOT}"usr/share/gcc-data/ || die |
80 |
- cp "${ROOT}${DATAPATH}"/fix_libtool_files.sh "${EROOT}"usr/sbin/ || die |
81 |
+ cp "${ROOT%/}${DATAPATH}"/fixlafiles.awk "${EROOT%/}"/usr/share/gcc-data/ || die |
82 |
+ cp "${ROOT%/}${DATAPATH}"/fix_libtool_files.sh "${EROOT%/}"/usr/sbin/ || die |
83 |
|
84 |
# Since these aren't critical files and portage sucks with |
85 |
# handling of binpkgs, don't require these to be found |
86 |
- cp "${ROOT}${DATAPATH}"/c{89,99} "${EROOT}"usr/bin/ 2>/dev/null |
87 |
+ cp "${ROOT%/}${DATAPATH}"/c{89,99} "${EROOT%/}"/usr/bin/ 2>/dev/null |
88 |
fi |
89 |
|
90 |
if use regression-test ; then |
91 |
@@ -2156,7 +2156,7 @@ toolchain_pkg_postinst() { |
92 |
} |
93 |
|
94 |
toolchain_pkg_postrm() { |
95 |
- if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
96 |
+ if [[ ! ${ROOT%/} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then |
97 |
eselect compiler-shadow clean all |
98 |
fi |
99 |
|
100 |
@@ -2167,16 +2167,16 @@ toolchain_pkg_postrm() { |
101 |
|
102 |
# clean up the cruft left behind by cross-compilers |
103 |
if is_crosscompile ; then |
104 |
- if [[ -z $(ls "${EROOT}"etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then |
105 |
- rm -f "${EROOT}"etc/env.d/gcc/config-${CTARGET} |
106 |
- rm -f "${EROOT}"etc/env.d/??gcc-${CTARGET} |
107 |
- rm -f "${EROOT}"usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64} |
108 |
+ if [[ -z $(ls "${EROOT%/}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then |
109 |
+ rm -f "${EROOT%/}"/etc/env.d/gcc/config-${CTARGET} |
110 |
+ rm -f "${EROOT%/}"/etc/env.d/??gcc-${CTARGET} |
111 |
+ rm -f "${EROOT%/}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64} |
112 |
fi |
113 |
return 0 |
114 |
fi |
115 |
|
116 |
# ROOT isnt handled by the script |
117 |
- [[ ${ROOT} != "/" ]] && return 0 |
118 |
+ [[ ${ROOT%/} ]] && return 0 |
119 |
|
120 |
if [[ ! -e ${LIBPATH}/libstdc++.so ]] ; then |
121 |
# make sure the profile is sane during same-slot upgrade #289403 |
122 |
@@ -2209,7 +2209,7 @@ do_gcc_config() { |
123 |
[[ -n ${current_specs} ]] && use_specs=-${current_specs} |
124 |
|
125 |
if [[ -n ${use_specs} ]] && \ |
126 |
- [[ ! -e ${ROOT}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]] |
127 |
+ [[ ! -e ${ROOT%/}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]] |
128 |
then |
129 |
ewarn "The currently selected specs-specific gcc config," |
130 |
ewarn "${current_specs}, doesn't exist anymore. This is usually" |