svn commit: r417113 - head/Mk
Mathieu Arnold
mat at FreeBSD.org
Sun Jun 19 11:25:45 UTC 2016
Author: mat
Date: Sun Jun 19 11:25:44 2016
New Revision: 417113
URL: https://svnweb.freebsd.org/changeset/ports/417113
Log:
Add a few checks for (MASTER|PATCH)_SITES groups.
While make(1) is ok with variable names having quite a lot of strange
characters in them, the fetch code mostly uses sh(1), where variable
names can't include a dash (or pluses, or many other things).
PR: 210251 210198
Submitted by: mat
Exp-run by: antoine
Sponsored by: The FreeBSD Foundation, Absolight
Differential Revision: https://reviews.freebsd.org/D6779
Modified:
head/Mk/bsd.port.mk (contents, props changed)
head/Mk/bsd.sites.mk (contents, props changed)
Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk Sun Jun 19 11:25:39 2016 (r417112)
+++ head/Mk/bsd.port.mk Sun Jun 19 11:25:44 2016 (r417113)
@@ -2202,6 +2202,12 @@ _S_TEMP= ${_S:S/^${_S:C@/?:[^/:]+$@/@}//
. if !empty(_S_TEMP)
. for _group in ${_S_TEMP:S/,/ /g}
_G_TEMP= ${_group}
+. if ${_G_TEMP:C/[a-zA-Z0-9_]//g}
+check-makevars::
+ @${ECHO_MSG} "The ${_S} MASTER_SITES line has"
+ @${ECHO_MSG} "a group with invalid characters, only use [a-zA-Z0-9_]"
+ @${FALSE}
+. endif
. 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"
@@ -2219,6 +2225,12 @@ _S_TEMP= ${_S:S/^${_S:C@/:[^/:]+$@/@}//:
. if !empty(_S_TEMP)
. for _group in ${_S_TEMP:S/,/ /g}
_G_TEMP= ${_group}
+. if ${_G_TEMP:C/[a-zA-Z0-9_]//g}
+check-makevars::
+ @${ECHO_MSG} "The ${_S} PATCH_SITES line has"
+ @${ECHO_MSG} "a group with invalid characters, only use [a-zA-Z0-9_]"
+ @${FALSE}
+. endif
. if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default
check-makevars::
@${ECHO_MSG} "The words all, ALL and default are reserved and cannot be"
Modified: head/Mk/bsd.sites.mk
==============================================================================
--- head/Mk/bsd.sites.mk Sun Jun 19 11:25:39 2016 (r417112)
+++ head/Mk/bsd.sites.mk Sun Jun 19 11:25:44 2016 (r417113)
@@ -522,6 +522,15 @@ IGNORE?= Using master as GH_TAGNAME is i
not "reroll" as soon as the branch is updated
. endif
. if defined(GH_TUPLE)
+.for _tuple in ${GH_TUPLE}
+_t_tmp=${_tuple}
+.if ${_t_tmp:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\4@:S/://:C/[a-zA-Z0-9_]//g}
+check-makevars::
+ @${ECHO_MSG} "The ${_tuple} GH_TUPLE line has"
+ @${ECHO_MSG} "a tag containing something else than [a-zA-Z0-9_]"
+ @${FALSE}
+.endif
+.endfor
GH_ACCOUNT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\1\4@}
GH_PROJECT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\2\4@}
GH_TAGNAME+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\3\4@}
More information about the svn-ports-head
mailing list