summaryrefslogtreecommitdiff
path: root/Mk/bsd.sites.mk
diff options
context:
space:
mode:
authorRichard Gallamore <ultima@FreeBSD.org>2017-09-04 18:35:50 +0000
committerRichard Gallamore <ultima@FreeBSD.org>2017-09-04 18:35:50 +0000
commitc74acc585cf22343a19bfe00935c93e572dde61e (patch)
tree4a9048ded883e3eb26bdd5cac52657ee856e8bd3 /Mk/bsd.sites.mk
parent- Update to 12712 (diff)
Cleanup duplicate code in USE_GITHUB
PR: 221816 Reviewed by: lifanov (mentor), matthew (mentor), mat Approved by: lifanov (mentor), matthew (mentor), mat Differential Revision: https://reviews.freebsd.org/D12125
Notes
Notes: svn path=/head/; revision=449253
Diffstat (limited to 'Mk/bsd.sites.mk')
-rw-r--r--Mk/bsd.sites.mk93
1 files changed, 17 insertions, 76 deletions
diff --git a/Mk/bsd.sites.mk b/Mk/bsd.sites.mk
index 6009dcab85d6..54c1b0f578d8 100644
--- a/Mk/bsd.sites.mk
+++ b/Mk/bsd.sites.mk
@@ -420,87 +420,28 @@ GH_PROJECT?= ${GH_PROJECT_DEFAULT}
# Use full PREFIX/SUFFIX and converted DISTVERSION
GH_TAGNAME_DEFAULT= ${DISTVERSIONFULL}
GH_TAGNAME?= ${GH_TAGNAME_DEFAULT}
-# Iterate over GH_ACCOUNT, GH_PROJECT and GH_TAGNAME to extract groups
+# Iterate over GH_ACCOUNT, GH_PROJECT, GH_TAGNAME and GH_SUBDIR to extract groups
_GITHUB_GROUPS= DEFAULT
-. for _A in ${GH_ACCOUNT}
-_S_TEMP= ${_A:S/^${_A:C@:[^/:]+$@@}//:S/^://}
-. if !empty(_S_TEMP)
-. for _group in ${_S_TEMP:S/,/ /g}
-_G_TEMP= ${_group}
-. if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
+. for _gh_v in GH_ACCOUNT GH_PROJECT GH_TAGNAME GH_SUBDIR
+. for _v_ex in ${${_gh_v}}
+_GH_GROUPS= ${_v_ex:S/^${_v_ex:C@:[^/:]+$@@}//:S/^://}
+. if !empty(_GH_GROUPS)
+. for _group in ${_GH_GROUPS:S/,/ /g}
+. if ${_group} == all || ${_group} == ALL || ${_group} == default
check-makevars::
@${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
- @${ECHO_MSG} "used in group definitions. Please fix your GH_ACCOUNT"
+ @${ECHO_MSG} "used in group definitions. Please fix your ${_gh_v}"
@${FALSE}
-. endif
-. if !${_GITHUB_GROUPS:M${_group}}
+. endif
+. if !${_GITHUB_GROUPS:M${_group}}
_GITHUB_GROUPS+= ${_group}
-. endif
-GH_ACCOUNT_${_group}= ${_A:C@^(.*):[^/:]+$@\1@}
-. endfor
-. else
-GH_ACCOUNT_DEFAULT= ${_A:C@^(.*):[^/:]+$@\1@}
-. endif
-. endfor
-. for _P in ${GH_PROJECT}
-_S_TEMP= ${_P:S/^${_P:C@:[^/:]+$@@}//:S/^://}
-. if !empty(_S_TEMP)
-. for _group in ${_S_TEMP:S/,/ /g}
-_G_TEMP= ${_group}
-. if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
-check-makevars::
- @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
- @${ECHO_MSG} "used in group definitions. Please fix your GH_PROJECT"
- @${FALSE}
-. endif
-. if !${_GITHUB_GROUPS:M${_group}}
-_GITHUB_GROUPS+= ${_group}
-. endif
-GH_PROJECT_${_group}= ${_P:C@^(.*):[^/:]+$@\1@}
-. endfor
-. else
-GH_PROJECT_DEFAULT= ${_P:C@^(.*):[^/:]+$@\1@}
-. endif
-. endfor
-. for _T in ${GH_TAGNAME}
-_S_TEMP= ${_T:S/^${_T:C@:[^/:]+$@@}//:S/^://}
-. if !empty(_S_TEMP)
-. for _group in ${_S_TEMP:S/,/ /g}
-_G_TEMP= ${_group}
-. if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
-check-makevars::
- @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
- @${ECHO_MSG} "used in group definitions. Please fix your GH_TAGNAME"
- @${FALSE}
-. endif
-. if !${_GITHUB_GROUPS:M${_group}}
-_GITHUB_GROUPS+= ${_group}
-. endif
-GH_TAGNAME_${_group}= ${_T:C@^(.*):[^/:]+$@\1@}
-. endfor
-. else
-GH_TAGNAME_DEFAULT= ${_T:C@^(.*):[^/:]+$@\1@}
-. endif
-. endfor
-. for _S in ${GH_SUBDIR}
-_S_SEMP= ${_S:S/^${_S:C@:[^/:]+$@@}//:S/^://}
-. if !empty(_S_SEMP)
-. for _group in ${_S_SEMP:S/,/ /g}
-_G_SEMP= ${_group}
-. if ${_G_SEMP} == all || ${_G_SEMP} == ALL || ${_G_SEMP} == default
-check-makevars::
- @${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be"
- @${ECHO_MSG} "used in group definitions. Please fix your GH_SUBDIR"
- @${FALSE}
-. endif
-. if !${_GITHUB_GROUPS:M${_group}}
-_GITHUB_GROUPS+= ${_group}
-. endif
-GH_SUBDIR_${_group}= ${_S:C@^(.*):[^/:]+$@\1@}
-. endfor
-. else
-GH_SUBDIR_DEFAULT= ${_S:C@^(.*):[^/:]+$@\1@}
-. endif
+. endif
+${_gh_v}_${_group}= ${_v_ex:C@^(.*):[^/:]+$@\1@}
+. endfor
+. else
+${_gh_v}_DEFAULT= ${_v_ex:C@^(.*):[^/:]+$@\1@}
+. endif
+. endfor
. endfor
# Put the default values back into the variables so that the *default* behavior
# is not changed.