git: cb9347f4a70d - main - ansible.mk: Improve argument parsing
Mateusz Piotrowski
0mp at FreeBSD.org
Mon May 17 16:29:30 UTC 2021
The branch main has been updated by 0mp:
URL: https://cgit.FreeBSD.org/ports/commit/?id=cb9347f4a70d2b3d1d5e3d88e2f727fa941a48f9
commit cb9347f4a70d2b3d1d5e3d88e2f727fa941a48f9
Author: Mateusz Piotrowski <0mp at FreeBSD.org>
AuthorDate: 2021-05-17 16:27:40 +0000
Commit: Mateusz Piotrowski <0mp at FreeBSD.org>
CommitDate: 2021-05-17 16:29:06 +0000
ansible.mk: Improve argument parsing
Reported by: arrowd
---
Mk/Uses/ansible.mk | 16 ++++++++++------
1 file 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*}
More information about the dev-commits-ports-all
mailing list