1 |
commit: e91202c9be35d70bb292efe0ce88bd583e1bf3ee |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 9 13:09:53 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 9 20:32:03 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e91202c9 |
7 |
|
8 |
toolchain.eclass: move from versionator to eapi7-ver eclass |
9 |
|
10 |
Preparation to EAPI=6+ support in gcc ebuilds. |
11 |
|
12 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
13 |
|
14 |
eclass/toolchain.eclass | 24 ++++++++++++------------ |
15 |
1 file changed, 12 insertions(+), 12 deletions(-) |
16 |
|
17 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
18 |
index 19564a0652e..018079ba937 100644 |
19 |
--- a/eclass/toolchain.eclass |
20 |
+++ b/eclass/toolchain.eclass |
21 |
@@ -8,7 +8,7 @@ DESCRIPTION="The GNU Compiler Collection" |
22 |
HOMEPAGE="https://gcc.gnu.org/" |
23 |
RESTRICT="strip" # cross-compilers need controlled stripping |
24 |
|
25 |
-inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs versionator prefix |
26 |
+inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix |
27 |
|
28 |
if [[ ${PV} == *_pre9999* ]] ; then |
29 |
EGIT_REPO_URI="git://gcc.gnu.org/git/gcc.git" |
30 |
@@ -26,8 +26,8 @@ FEATURES=${FEATURES/multilib-strict/} |
31 |
|
32 |
case ${EAPI:-0} in |
33 |
0|1|2|3|4*) die "Need to upgrade to at least EAPI=5" ;; |
34 |
- 5*) ;; |
35 |
- *) die "I don't speak EAPI ${EAPI}." ;; |
36 |
+ 5*) inherit eapi7-ver ;; |
37 |
+ *) die "I don't speak EAPI ${EAPI}." ;; |
38 |
esac |
39 |
EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure \ |
40 |
src_compile src_test src_install pkg_postinst pkg_postrm |
41 |
@@ -50,7 +50,7 @@ is_crosscompile() { |
42 |
|
43 |
# General purpose version check. Without a second arg matches up to minor version (x.x.x) |
44 |
tc_version_is_at_least() { |
45 |
- version_is_at_least "$1" "${2:-${GCC_RELEASE_VER}}" |
46 |
+ ver_test "${2:-${GCC_RELEASE_VER}}" -ge "$1" |
47 |
} |
48 |
|
49 |
# General purpose version range check |
50 |
@@ -62,17 +62,17 @@ tc_version_is_between() { |
51 |
GCC_PV=${TOOLCHAIN_GCC_PV:-${PV}} |
52 |
GCC_PVR=${GCC_PV} |
53 |
[[ ${PR} != "r0" ]] && GCC_PVR=${GCC_PVR}-${PR} |
54 |
-GCC_RELEASE_VER=$(get_version_component_range 1-3 ${GCC_PV}) |
55 |
-GCC_BRANCH_VER=$(get_version_component_range 1-2 ${GCC_PV}) |
56 |
-GCCMAJOR=$(get_version_component_range 1 ${GCC_PV}) |
57 |
-GCCMINOR=$(get_version_component_range 2 ${GCC_PV}) |
58 |
-GCCMICRO=$(get_version_component_range 3 ${GCC_PV}) |
59 |
+GCC_RELEASE_VER=$(ver_cut 1-3 ${GCC_PV}) |
60 |
+GCC_BRANCH_VER=$(ver_cut 1-2 ${GCC_PV}) |
61 |
+GCCMAJOR=$(ver_cut 1 ${GCC_PV}) |
62 |
+GCCMINOR=$(ver_cut 2 ${GCC_PV}) |
63 |
+GCCMICRO=$(ver_cut 3 ${GCC_PV}) |
64 |
[[ ${BRANCH_UPDATE-notset} == "notset" ]] && \ |
65 |
- BRANCH_UPDATE=$(get_version_component_range 4 ${GCC_PV}) |
66 |
+ BRANCH_UPDATE=$(ver_cut 4 ${GCC_PV}) |
67 |
|
68 |
# According to gcc/c-cppbuiltin.c, GCC_CONFIG_VER MUST match this regex. |
69 |
# ([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? |
70 |
-GCC_CONFIG_VER=${GCC_CONFIG_VER:-$(replace_version_separator 3 '-' ${GCC_PV})} |
71 |
+GCC_CONFIG_VER=${GCC_CONFIG_VER:-$(ver_rs 3 '-' ${GCC_PV})} |
72 |
|
73 |
# Pre-release support |
74 |
if [[ ${GCC_PV} == *_pre* ]] ; then |
75 |
@@ -2290,7 +2290,7 @@ should_we_gcc_config() { |
76 |
# for being in the same SLOT, make sure we run gcc-config. |
77 |
local curr_config_ver=$(gcc-config -S ${curr_config} | awk '{print $2}') |
78 |
|
79 |
- local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver}) |
80 |
+ local curr_branch_ver=$(ver_cut 1-2 ${curr_config_ver}) |
81 |
|
82 |
if [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then |
83 |
return 0 |