commit:     24db6037e69ca7fe9c425cec72111866377adb25
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 15:53:24 2016 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 15:56:35 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24db6037

git-r3.eclass: Make git[curl] warning non-fatal, extend to HTTP, #597356

Make the warning about missing dev-vcs/git[curl] for HTTP(S) support
non-fatal since the ebuild can specify non-HTTP(S) fallback URIs which
would otherwise be ignored. The eclass will die if all URIs fail anyway.

Extend the check to cover both HTTPS and plain HTTP.

Reported by Coacher.

Bug: https://bugs.gentoo.org/597356

 eclass/git-r3.eclass | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index 0ac9d90..817638d 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -593,13 +593,18 @@ git-r3_fetch() {
                        local fetch_command=( git fetch "${r}" )
                        local clone_type=${EGIT_CLONE_TYPE}
 
-                       if [[ ${r} == https://* ]] && ! ROOT=/ has_version 
'dev-vcs/git[curl]'; then
-                               eerror "git-r3: fetching from https:// 
requested. In order to support https,"
-                               eerror "dev-vcs/git needs to be built with 
USE=curl. Example solution:"
-                               eerror
-                               eerror "        echo dev-vcs/git curl >> 
/etc/portage/package.use"
-                               eerror "        emerge -1v dev-vcs/git"
-                               die "dev-vcs/git built with USE=curl required."
+                       if [[ ${r} == http://* || ${r} == https://* ]] &&
+                                       [[ ! ${EGIT_CURL_WARNED} ]] &&
+                                       ! ROOT=/ has_version 'dev-vcs/git[curl]'
+                       then
+                               ewarn "git-r3: fetching from HTTP(S) requested. 
In order to support HTTP(S),"
+                               ewarn "dev-vcs/git needs to be built with 
USE=curl. Example solution:"
+                               ewarn
+                               ewarn " echo dev-vcs/git curl >> 
/etc/portage/package.use"
+                               ewarn " emerge -1v dev-vcs/git"
+                               ewarn
+                               ewarn "HTTP(S) URIs will be skipped."
+                               EGIT_CURL_WARNED=1
                        fi
 
                        if [[ ${clone_type} == mirror ]]; then

Reply via email to