From owner-dev-commits-ports-main@freebsd.org Mon May 17 16:29:30 2021 Return-Path: Delivered-To: dev-commits-ports-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCA4764CA1A; Mon, 17 May 2021 16:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FkPjQ5x8Zz4VNn; Mon, 17 May 2021 16:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B35557520; Mon, 17 May 2021 16:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14HGTU8c066841; Mon, 17 May 2021 16:29:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14HGTUnL066840; Mon, 17 May 2021 16:29:30 GMT (envelope-from git) Date: Mon, 17 May 2021 16:29:30 GMT Message-Id: <202105171629.14HGTUnL066840@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: cb9347f4a70d - main - ansible.mk: Improve argument parsing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb9347f4a70d2b3d1d5e3d88e2f727fa941a48f9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the main branch of the FreeBSD ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2021 16:29:30 -0000 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*}