Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/8] git-r3.eclass: Support EAPI 7
Date: Thu, 03 May 2018 10:19:18
Message-Id: 20180503101811.28837-3-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one by "Michał Górny"
1 Enable support for EAPI 7. Use BDEPEND for dev-vcs/git dependency
2 since git is run at build time. Update has_version logic appropriately.
3 ---
4 eclass/git-r3.eclass | 39 +++++++++++++++++++++++++++------------
5 1 file changed, 27 insertions(+), 12 deletions(-)
6
7 diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
8 index 75a589d0168d..279f03269314 100644
9 --- a/eclass/git-r3.eclass
10 +++ b/eclass/git-r3.eclass
11 @@ -1,4 +1,4 @@
12 -# Copyright 1999-2017 Gentoo Foundation
13 +# Copyright 1999-2018 Gentoo Foundation
14 # Distributed under the terms of the GNU General Public License v2
15
16 # @ECLASS: git-r3.eclass
17 @@ -10,7 +10,7 @@
18 # git as remote repository.
19
20 case "${EAPI:-0}" in
21 - 0|1|2|3|4|5|6)
22 + 0|1|2|3|4|5|6|7)
23 ;;
24 *)
25 die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
26 @@ -22,7 +22,11 @@ EXPORT_FUNCTIONS src_unpack
27 if [[ ! ${_GIT_R3} ]]; then
28
29 if [[ ! ${_INHERITED_BY_GIT_2} ]]; then
30 - DEPEND=">=dev-vcs/git-1.8.2.1"
31 + if [[ ${EAPI:-0} != [0123456] ]]; then
32 + BDEPEND=">=dev-vcs/git-1.8.2.1"
33 + else
34 + DEPEND=">=dev-vcs/git-1.8.2.1"
35 + fi
36 fi
37
38 # @ECLASS-VARIABLE: EGIT_CLONE_TYPE
39 @@ -648,16 +652,27 @@ git-r3_fetch() {
40 local clone_type=${EGIT_CLONE_TYPE}
41
42 if [[ ${r} == http://* || ${r} == https://* ]] &&
43 - [[ ! ${EGIT_CURL_WARNED} ]] &&
44 - ! ROOT=/ has_version 'dev-vcs/git[curl]'
45 + [[ ! ${EGIT_CURL_WARNED} ]]
46 then
47 - ewarn "git-r3: fetching from HTTP(S) requested. In order to support HTTP(S),"
48 - ewarn "dev-vcs/git needs to be built with USE=curl. Example solution:"
49 - ewarn
50 - ewarn " echo dev-vcs/git curl >> /etc/portage/package.use"
51 - ewarn " emerge -1v dev-vcs/git"
52 - ewarn
53 - ewarn "HTTP(S) URIs will be skipped."
54 + case ${EAPI:-0} in
55 + 0|1|2|3|4)
56 + ROOT=/ has_version 'dev-vcs/git[curl]';;
57 + 5|6)
58 + has_version --host-root 'dev-vcs/git[curl]';;
59 + *)
60 + has_version -b 'dev-vcs/git[curl]';;
61 + esac
62 +
63 + if [[ ${?} -ne 0 ]]; then
64 + ewarn "git-r3: fetching from HTTP(S) requested. In order to support HTTP(S),"
65 + ewarn "dev-vcs/git needs to be built with USE=curl. Example solution:"
66 + ewarn
67 + ewarn " echo dev-vcs/git curl >> /etc/portage/package.use"
68 + ewarn " emerge -1v dev-vcs/git"
69 + ewarn
70 + ewarn "HTTP(S) URIs will be skipped."
71 + fi
72 +
73 EGIT_CURL_WARNED=1
74 fi
75
76 --
77 2.17.0