aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2016-06-19 19:25:44 +0800
committermat <mat@FreeBSD.org>2016-06-19 19:25:44 +0800
commitf29308cd2c448c2843ab3f7fdfbd3e40566c0e25 (patch)
tree976c7ab510c8828deef279082e23b0e38a358680 /Mk/bsd.port.mk
parent4355a44f5fcc35a912543d35ebe0da429206a74e (diff)
downloadfreebsd-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/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk12
1 files changed, 12 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"