1 |
commit: 3b754f48af5078af9152f29cdd9b09507eb29423 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 25 23:19:48 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 26 00:06:25 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b754f48 |
7 |
|
8 |
toolchain.eclass: hide '${PV} == *9999*' to tc_is_live helper |
9 |
|
10 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
11 |
|
12 |
eclass/toolchain.eclass | 24 ++++++++++++++++-------- |
13 |
1 file changed, 16 insertions(+), 8 deletions(-) |
14 |
|
15 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
16 |
index 5acaa2ffc68..5033708c7e5 100644 |
17 |
--- a/eclass/toolchain.eclass |
18 |
+++ b/eclass/toolchain.eclass |
19 |
@@ -9,7 +9,11 @@ HOMEPAGE="https://gcc.gnu.org/" |
20 |
|
21 |
inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs prefix |
22 |
|
23 |
-if [[ ${PV} == *9999* ]] ; then |
24 |
+tc_is_live() { |
25 |
+ [[ ${PV} == *9999* ]] |
26 |
+} |
27 |
+ |
28 |
+if tc_is_live ; then |
29 |
EGIT_REPO_URI="git://gcc.gnu.org/git/gcc.git" |
30 |
# naming style: |
31 |
# gcc-10.1.0_pre9999 -> gcc-10-branch |
32 |
@@ -258,7 +262,7 @@ PDEPEND=">=sys-devel/gcc-config-1.7" |
33 |
# Set the source directory depending on whether we're using |
34 |
# a prerelease, snapshot, or release tarball. |
35 |
S=$( |
36 |
- if [[ ${PV} == *9999* ]]; then |
37 |
+ if tc_is_live ; then |
38 |
echo ${EGIT_CHECKOUT_DIR} |
39 |
elif [[ -n ${PRERELEASE} ]] ; then |
40 |
echo ${WORKDIR}/gcc-${PRERELEASE} |
41 |
@@ -344,7 +348,7 @@ get_gcc_src_uri() { |
42 |
|
43 |
# Set where to download gcc itself depending on whether we're using a |
44 |
# prerelease, snapshot, or release tarball. |
45 |
- if [[ ${PV} == *9999* ]] ; then |
46 |
+ if tc_is_live ; then |
47 |
# Nothing to do w/git snapshots. |
48 |
: |
49 |
elif [[ -n ${PRERELEASE} ]] ; then |
50 |
@@ -409,8 +413,12 @@ SRC_URI=$(get_gcc_src_uri) |
51 |
|
52 |
#---->> pkg_pretend <<---- |
53 |
|
54 |
+toolchain_is_unsupported() { |
55 |
+ [[ -n ${PRERELEASE}${SNAPSHOT} ]] || tc_is_live |
56 |
+} |
57 |
+ |
58 |
toolchain_pkg_pretend() { |
59 |
- if [[ -n ${PRERELEASE}${SNAPSHOT} || ${PV} == *9999* ]] && |
60 |
+ if toolchain_is_unsupported && |
61 |
[[ -z ${I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS} ]] ; then |
62 |
die "Please \`export I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1\` or define it" \ |
63 |
"in your make.conf if you want to use this version." |
64 |
@@ -436,7 +444,7 @@ toolchain_pkg_setup() { |
65 |
#---->> src_unpack <<---- |
66 |
|
67 |
toolchain_src_unpack() { |
68 |
- if [[ ${PV} == *9999* ]]; then |
69 |
+ if tc_is_live ; then |
70 |
git-r3_src_unpack |
71 |
fi |
72 |
|
73 |
@@ -455,7 +463,7 @@ gcc_quick_unpack() { |
74 |
# 'GCC_A_FAKEIT' to specify it's own source and binary tarballs. |
75 |
if [[ -n ${GCC_A_FAKEIT} ]] ; then |
76 |
unpack ${GCC_A_FAKEIT} |
77 |
- elif [[ ${PV} == *9999* ]]; then |
78 |
+ elif tc_is_live ; then |
79 |
: # sources comes from git, not tarball |
80 |
elif [[ -n ${PRERELEASE} ]] ; then |
81 |
unpack gcc-${PRERELEASE}.tar.bz2 |
82 |
@@ -465,7 +473,7 @@ gcc_quick_unpack() { |
83 |
else |
84 |
unpack gcc-${SNAPSHOT}.tar.bz2 |
85 |
fi |
86 |
- elif [[ ${PV} != *9999* ]] ; then |
87 |
+ else |
88 |
if tc_version_is_between 5.5 6 || tc_version_is_between 6.4 7 || tc_version_is_at_least 7.2 ; then |
89 |
unpack gcc-${GCC_RELEASE_VER}.tar.xz |
90 |
else |
91 |
@@ -538,7 +546,7 @@ toolchain_src_prepare() { |
92 |
do_gcc_PIE_patches |
93 |
do_gcc_CYGWINPORTS_patches |
94 |
|
95 |
- if [[ ${PV} == *9999* ]] ; then |
96 |
+ if tc_is_live ; then |
97 |
BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, commit ${EGIT_VERSION}" |
98 |
fi |