aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorMathieu Arnold <mat@FreeBSD.org>2017-11-02 23:16:31 +0800
committerMathieu Arnold <mat@FreeBSD.org>2017-11-02 23:16:31 +0800
commitd45d670c33cdfa588353a920d63284e392fa7ab9 (patch)
tree56663eaa64116ecb3fd72edaa0ac02a845fc8d63 /Mk/bsd.port.mk
parent123df59a89e9e8db932ad83c1f6425e27bb6c700 (diff)
downloadfreebsd-ports-gnome-d45d670c33cdfa588353a920d63284e392fa7ab9.tar.gz
freebsd-ports-gnome-d45d670c33cdfa588353a920d63284e392fa7ab9.tar.zst
freebsd-ports-gnome-d45d670c33cdfa588353a920d63284e392fa7ab9.zip
Add a check for options names.
They must be all uppercase, so that they do not conflict with flavors that are lowercase. Reviewed by: bapt Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D12810
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index b02960c31d76..21b5dd601410 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -4659,6 +4659,24 @@ ${_t}:
.if !target(pre-check-config)
pre-check-config:
+_CHECK_OPTIONS_NAMES= OPTIONS_DEFINE
+_CHECK_OPTIONS_NAMES+= ${OPTIONS_GROUP:S/^/OPTIONS_GROUP_/}
+_CHECK_OPTIONS_NAMES+= ${OPTIONS_MULTI:S/^/OPTIONS_MULTI_/}
+_CHECK_OPTIONS_NAMES+= ${OPTIONS_RADIO:S/^/OPTIONS_RADIO_/}
+_CHECK_OPTIONS_NAMES+= ${OPTIONS_SINGLE:S/^/OPTIONS_SINGLE_/}
+.for var in ${_CHECK_OPTIONS_NAMES}
+. if defined(${var})
+. for o in ${${var}}
+. if ${o:C/[-_[:upper:][:digit:]]//g}
+OPTIONS_BAD_NAMES+= ${o}
+. endif
+. endfor
+. endif
+.endfor
+.if defined(OPTIONS_BAD_NAMES) && !empty(OPTIONS_BAD_NAMES)
+DEV_WARNING+= "These options name have characters outside of [-_A-Z0-9]:"
+DEV_WARNING+= "${OPTIONS_BAD_NAMES:O:u}"
+.endif
.for single in ${OPTIONS_SINGLE}
. for opt in ${OPTIONS_SINGLE_${single}}
. if empty(ALL_OPTIONS:M${single}) || !empty(PORT_OPTIONS:M${single})