From owner-svn-ports-head@freebsd.org Mon Sep 4 18:35:51 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E927E168C7; Mon, 4 Sep 2017 18:35:51 +0000 (UTC) (envelope-from ultima@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 678EB80EAB; Mon, 4 Sep 2017 18:35:51 +0000 (UTC) (envelope-from ultima@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v84IZoCO010008; Mon, 4 Sep 2017 18:35:50 GMT (envelope-from ultima@FreeBSD.org) Received: (from ultima@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v84IZoma010007; Mon, 4 Sep 2017 18:35:50 GMT (envelope-from ultima@FreeBSD.org) Message-Id: <201709041835.v84IZoma010007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ultima set sender to ultima@FreeBSD.org using -f From: Richard Gallamore Date: Mon, 4 Sep 2017 18:35:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r449253 - head/Mk X-SVN-Group: ports-head X-SVN-Commit-Author: ultima X-SVN-Commit-Paths: head/Mk X-SVN-Commit-Revision: 449253 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 18:35:51 -0000 Author: ultima Date: Mon Sep 4 18:35:50 2017 New Revision: 449253 URL: https://svnweb.freebsd.org/changeset/ports/449253 Log: 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 Modified: head/Mk/bsd.sites.mk Modified: head/Mk/bsd.sites.mk ============================================================================== --- head/Mk/bsd.sites.mk Mon Sep 4 15:38:28 2017 (r449252) +++ head/Mk/bsd.sites.mk Mon Sep 4 18:35:50 2017 (r449253) @@ -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.