commit: d76b5aaf4e03efd2c96c7226584a7a584f4241c7 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org> AuthorDate: Thu Jun 25 11:03:10 2015 +0000 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org> CommitDate: Thu Jun 25 11:03:10 2015 +0000 URL: https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=d76b5aaf
[eclass] Fix live ebuild logic. eclass/github.eclass | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/eclass/github.eclass b/eclass/github.eclass index d4691ef..6c302f5 100644 --- a/eclass/github.eclass +++ b/eclass/github.eclass @@ -31,9 +31,10 @@ esac : ${GH_REPO:=${PN}} # @ECLASS-VARIABLE: GH_BUILD_TYPE +# @DEFAULT-UNSET # @DESCRIPTION: -# Live ebuilds use "live" here. -: ${GH_BUILD_TYPE:=default} +# Defines if fetched from git ("live") or tarball ("release") +# Use if autodetection via PV fails. # @ECLASS-VARIABLE: GH_PATCHES # @DEFAULT_UNSET @@ -52,15 +53,21 @@ esac inherit eutils -if [[ ${PV} == *9999 ]]; then - GH_BUILD_TYPE=live +if [[ -z ${GH_BUILD_TYPE} ]]; then + if [[ ${PV} == *9999 ]]; then + _GH_BUILD_TYPE=live + else + _GH_BUILD_TYPE=release + fi +else + _GH_BUILD_TYPE=$GH_BUILD_TYPE fi if [[ ${GH_BUILD_TYPE} = live ]]; then inherit git-r3 fi -if [[ ${GH_BUILD_TYPE} = default ]]; then +if [[ ${GH_BUILD_TYPE} = release ]]; then inherit vcs-snapshot fi @@ -115,7 +122,7 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" github_src_unpack() { debug-print-function ${FUNCNAME} "$@" - if [[ ${GH_BUILD_TYPE} = live ]]; then + if [[ ${_GH_BUILD_TYPE} = live ]]; then git-r3_src_unpack else vcs-snapshot_src_unpack