Gentoo Archives: gentoo-commits

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