diff options
author | mat <mat@FreeBSD.org> | 2016-06-19 19:25:44 +0800 |
---|---|---|
committer | mat <mat@FreeBSD.org> | 2016-06-19 19:25:44 +0800 |
commit | f29308cd2c448c2843ab3f7fdfbd3e40566c0e25 (patch) | |
tree | 976c7ab510c8828deef279082e23b0e38a358680 /Mk | |
parent | 4355a44f5fcc35a912543d35ebe0da429206a74e (diff) | |
download | freebsd-ports-gnome-f29308cd2c448c2843ab3f7fdfbd3e40566c0e25.tar.gz freebsd-ports-gnome-f29308cd2c448c2843ab3f7fdfbd3e40566c0e25.tar.zst freebsd-ports-gnome-f29308cd2c448c2843ab3f7fdfbd3e40566c0e25.zip |
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
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/bsd.port.mk | 12 | ||||
-rw-r--r-- | Mk/bsd.sites.mk | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 09aa3f76b905..0f08760d3164 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -2202,6 +2202,12 @@ _S_TEMP= ${_S:S/^${_S:C@/?:[^/:]+$@/@}//:S/^://} . 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@/:[^/:]+$@/@}//:S/^://} . 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" diff --git a/Mk/bsd.sites.mk b/Mk/bsd.sites.mk index f516023000a7..94fa6805aa04 100644 --- a/Mk/bsd.sites.mk +++ b/Mk/bsd.sites.mk @@ -522,6 +522,15 @@ IGNORE?= Using master as GH_TAGNAME is invalid. \ 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@} |