Index: Mk/bsd.sites.mk =================================================================== --- Mk/bsd.sites.mk +++ Mk/bsd.sites.mk @@ -519,6 +519,7 @@ # Using the name of a branch here is incorrect. It is # possible to do GH_TAGNAME= GIT_HASH to do a snapshot. # default: ${DISTVERSION} +# GH_TUPLE - above shortened to account:project:tagname[:group] # .if defined(USE_GITHUB) . if defined(GH_TAGNAME) && ${GH_TAGNAME} == master @@ -526,6 +527,35 @@ Must use a tag or commit hash so the upstream does \ not "reroll" as soon as the branch is updated . endif +. if defined(GH_TUPLE) +GH_ACCOUNT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\1\4@} +GH_PROJECT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\2\4@} +GH_TAGNAME+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\3\4@} + +.for _TUPLE_TMP in ${GH_TUPLE} +_TUPLE=${_TUPLE_TMP} +_ACCOUNT= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\1@} +_PROJECT= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\2@} +_TAGNAME= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\3@} +_GROUP= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\4@:C@-@_@g} +_GROUP2= ${_GROUP:C/^://} +_GIT_REV_GET+= GIT_REV_${_GROUP2}=`git ls-remote https://github.com/${_ACCOUNT}/${_PROJECT}.git HEAD | ${SED} -E "s/^(.......).*/\\1/g"` && +_GIT_REV_ECHO+= echo "GH_TUPLE+= ${_ACCOUNT}:${_PROJECT}:$${GIT_REV_${_GROUP2}}${_GROUP}" && +_GIT_REV_CHANGE+=if [ ${_TAGNAME} != "\$$GIT_REV_${_GROUP2}" ]; then echo "GH_TUPLE+= ${_ACCOUNT}:${_PROJECT}:$${GIT_REV_${_GROUP2}}${_GROUP}"; fi && +.endfor + +gh-get-latest-revisions: + @${ECHO} "--begin latest revisions--" && \ + ${_GIT_REV_GET} \ + ${_GIT_REV_ECHO} \ + ${ECHO} "--end latest revisions--" + +gh-get-changed-revisions: + @${ECHO} "--begin changed revisions--" && \ + ${_GIT_REV_GET} \ + ${_GIT_REV_CHANGE} \ + ${ECHO} "--end changed revisions--" +. endif # We are cheating and using backend URLS for Github here. See ports/194898 # comment #15 for explanation as to why and how to deal with it if it breaks. MASTER_SITE_GITHUB+= https://codeload.github.com/%SUBDIR%