aboutsummaryrefslogtreecommitdiff
path: root/Mk/Uses
diff options
context:
space:
mode:
authorMateusz Piotrowski <0mp@FreeBSD.org>2021-05-17 16:27:40 +0000
committerMateusz Piotrowski <0mp@FreeBSD.org>2021-05-17 16:29:06 +0000
commitcb9347f4a70d2b3d1d5e3d88e2f727fa941a48f9 (patch)
treee495f0db99973d7a71eb5bcd360f62a880bb6de8 /Mk/Uses
parentb3577416a323b73ec11c93f2de6f0d90abf18926 (diff)
downloadports-cb9347f4a70d2b3d1d5e3d88e2f727fa941a48f9.tar.gz
ports-cb9347f4a70d2b3d1d5e3d88e2f727fa941a48f9.zip
ansible.mk: Improve argument parsing
Reported by: arrowd
Diffstat (limited to 'Mk/Uses')
-rw-r--r--Mk/Uses/ansible.mk16
1 files changed, 10 insertions, 6 deletions
diff --git a/Mk/Uses/ansible.mk b/Mk/Uses/ansible.mk
index 7814e5c8a17b..9547df262540 100644
--- a/Mk/Uses/ansible.mk
+++ b/Mk/Uses/ansible.mk
@@ -39,13 +39,17 @@
.if !defined(_INCLUDE_USES_ANSIBLE_Mk)
_INCLUDE_USES_ANSIBLE_Mk= yes
+_valid_ARGS= env module plugin
+.for _arg in ${ansible_ARGS}
+. if !${_valid_ARGS:M${_arg}}
+IGNORE= USES=ansible: invalid argument: ${_arg}
+. endif
+.endfor
+.if ${ansible_ARGS:[#]} != 1
+IGNORE= USES=ansible: too many arguments: ${ansible_ARGS}
+.endif
.if empty(ansible_ARGS)
-IGNORE= no arguments specified to USES=ansible
-.elif ${ansible_ARGS} == "env"
-.elif ${ansible_ARGS} == "module"
-.elif ${ansible_ARGS} == "plugin"
-.else
-IGNORE= uses unknown USES=ansible arguments: ${ansible_ARGS}
+IGNORE= USES=ansible: no arguments specified
.endif
.if !${USES:Mpython*}