From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8120C158086 for ; Thu, 9 Dec 2021 07:38:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 94AC02BC04A; Thu, 9 Dec 2021 07:38:48 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 48EBC2BC007 for ; Thu, 9 Dec 2021 07:38:48 +0000 (UTC) From: Ulrich Mueller To: Maciej =?utf-8?Q?Bar=C4=87?= Cc: gentoo-dev@lists.gentoo.org, ml@gentoo.org Subject: Re: [gentoo-dev] [PATCH] eclass/dune.eclass: fixes In-Reply-To: <20211208234943.59357-1-xgqt@gentoo.org> ("Maciej =?utf-8?Q?B?= =?utf-8?Q?ar=C4=87=22's?= message of "Thu, 9 Dec 2021 00:49:43 +0100") References: <20211208234943.59357-1-xgqt@gentoo.org> Date: Thu, 09 Dec 2021 08:38:37 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Archives-Salt: a889cf14-112f-4ae6-9cf5-6ddc2e6dabb0 X-Archives-Hash: c7241f9e999da384e0bd0eadda3706e0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> On Thu, 09 Dec 2021, Maciej Bar=C4=87 wrote: > dune-install() { > + local pkgs > + if [[ -n "${@}" ]] ; then > + pkgs=3D"${@}" > + else > + pkgs=3D${DUNE_PKG_NAME} > + fi > + > + local myduneopts=3D( > + --prefix=3D"${ED%/}/usr" > + --libdir=3D"${D%/}$(ocamlc -where)" > + --mandir=3D"${ED%/}/usr/share/man" > + ) > local pkg > - for pkg ; do > - dune install \ > - --prefix=3D"${ED%/}/usr" \ > - --libdir=3D"${D%/}$(ocamlc -where)" \ > - --mandir=3D"${ED%/}/usr/share/man" \ > - "${pkg}" || die > + for pkg in "${pkgs}" ; do > + dune install ${myduneopts[@]} ${pkg} || die > done > } Have you tested this? IIUC, the space separated list of arguments is assigned to pkgs, with a fallback to ${DUNE_PKG_NAME}. The 'for pkg in "${pkgs}"' loop isn't actually a loop because ${pkgs} is inside double quotes, so it will be executed only once with pkg being equal to pkgs. The previous logic (simple 'for pkg' which will loop over $@) was correct but of course without the fallback. > +dune_src_install() { > + dune-install ${1:-${DUNE_PKG_NAME}} > +} Do you even need the fallback in dune_install() if you have it here too? Ulrich --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmGxsn0PHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4upPEIALEfdLldux7ogrKs/VEP/KXNG2UphvtQvq5r KZQ9ArPF7ianzhRqmshu9NiLMgz5myW6E+U0rzrWKIMMWRHTMs64ttTmEOXKZyQe cLDH8sIotZCnQmQPelqIGRRN3ha9+weC0n2aHDymrz1H1T04KBBt+rtRIHal9BpH 2NEySQ/XrAnreWx9vBSGBOeBB3hKRd28GyB3AiYgbMiXQRmmDXASP7SauFBpl6iI 5Y3XoNfyUSvUcBfUoKxpxBOT/IsDp/J2wfUvU9MiYrgB61Bal3YcULJk8QU4a3n8 daoldE+tdO48zz90vvpEWW/epkNfSgtLIjz98jcdFpJzAwupysI= =hJef -----END PGP SIGNATURE----- --=-=-=--