Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 May 2021 16:29:30 GMT
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: cb9347f4a70d - main - ansible.mk: Improve argument parsing
Message-ID:  <202105171629.14HGTUnL066840@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by 0mp:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cb9347f4a70d2b3d1d5e3d88e2f727fa941a48f9

commit cb9347f4a70d2b3d1d5e3d88e2f727fa941a48f9
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2021-05-17 16:27:40 +0000
Commit:     Mateusz Piotrowski <0mp@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*}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105171629.14HGTUnL066840>