git-r3.eclass: Make git[curl] warning non-fatal, extend to HTTP, #597356
authorMichał Górny <mgorny@gentoo.org>
Mon, 17 Oct 2016 15:53:24 +0000 (17:53 +0200)
committerMichał Górny <mgorny@gentoo.org>
Mon, 17 Oct 2016 15:56:35 +0000 (17:56 +0200)
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

index 0ac9d908729e1ea1c28a1655ba7489409887ac5a..817638dc0de471cd7e54fb70142a08d3ea943e74 100644 (file)
@@ -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