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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7D37D138334 for ; Wed, 25 Sep 2019 19:44:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D8484E08F7; Wed, 25 Sep 2019 19:44:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9917CE08EF for ; Wed, 25 Sep 2019 19:44:51 +0000 (UTC) Received: from pomiot (c134-66.icpnet.pl [85.221.134.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id D1C5834B5A4; Wed, 25 Sep 2019 19:44:48 +0000 (UTC) Message-ID: Subject: Re: [gentoo-dev] RFC: ant-tasks.eclass patch From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Wed, 25 Sep 2019 21:44:44 +0200 In-Reply-To: References: Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-+Bh84uQvVAW6orY4FtDt" User-Agent: Evolution 3.32.4 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 X-Archives-Salt: 08fc7850-3c42-4ac8-a61a-f6e8b673682b X-Archives-Hash: d7bd660745f396d6741a0c2f9f9f86a8 --=-+Bh84uQvVAW6orY4FtDt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2019-09-25 at 20:47 +0200, Miroslav =C5=A0ulc wrote: > diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass > index 309df084d156..26df9de26f1a 100644 > --- a/eclass/ant-tasks.eclass > +++ b/eclass/ant-tasks.eclass > @@ -54,7 +54,9 @@ ANT_TASK_NAME=3D"${PN#ant-}" > # @DESCRIPTION: > # Specifies JAVA_PKG_NAME (PN{-SLOT} used with java-pkg_jar-from) of the= package > # that this one depends on. Defaults to the name of ant task, ebuild can > -# override it before inheriting this eclass. > +# override it before inheriting this eclass. In case there is more than = one > +# dependency, the variable can be specified as bash array with multiple = strings, > +# one for each dependency. > ANT_TASK_DEPNAME=3D${ANT_TASK_DEPNAME-${ANT_TASK_NAME}} > =20 > # @ECLASS-VARIABLE: ANT_TASK_DISABLE_VM_DEPS > @@ -105,7 +107,7 @@ S=3D"${WORKDIR}/${MY_P}" > # base: performs the unpack, build.xml replacement and symlinks ant.jar = from > # ant-core > # > -# jar-dep: symlinks the jar file(s) from dependency package > +# jar-dep: symlinks the jar file(s) from dependency package(s) > ant-tasks_src_unpack() { > [[ -z "${1}" ]] && ant-tasks_src_unpack all > =20 > @@ -129,9 +131,17 @@ ant-tasks_src_unpack() { > # ant.jar to build against > java-pkg_jar-from --build-only ant-core ant.jar;; > jar-dep) > - # get jar from the dependency package > + # get jar from the dependency package(s) > if [[ -n "${ANT_TASK_DEPNAME}" ]]; then > - java-pkg_jar-from ${ANT_TASK_DEPNAME} > + local array=3D$(declare -p ANT_TASK_DEPNAME | grep "^declare \-a") > + > + if [[ -n "${array}" ]]; then > + for depname in "${ANT_TASK_DEPNAME[@]}"; do > + java-pkg_jar-from ${depname} > + done I don't think you need two branches here. Non-array variable is equivalent to an array with a single element for the purpose of [@], so your 'for' loop will work correctly both for non-array and array. > + else > + java-pkg_jar-from ${ANT_TASK_DEPNAME} > + fi > fi;; > all) > ant-tasks_src_unpack base jar-dep;; --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-+Bh84uQvVAW6orY4FtDt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQGTBAABCgB9FiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAl2Lw6xfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3 NkE4NDUwOTQwOThEMjhDQzhCMjZDNTYzOUFEQUUyMzI5RTI0MEUACgkQY5ra4jKe JA4XZAf/S5S5qzFAiEAljyzSB59T1F7P91WBDforEx26ezbBzYKjoPdrON2qJeok c45mQxGKDHheWCllUlbTd2A9eDFMr4lF7qvVIqAQJP8FPp20MGgLXn8PYC/ja12y rp58FKrmnw4/Co4KwoAjPunm1sOjCBN+En1e9tc8RdoV5uWoI5ZDfjnFMTHh7P+3 sK2Jecpzr3qUXfe0RyJ0lUZ2zJGlwUo4rn7bHBmJ+9v79hVvOxroAb46YECG6GXg 97xQNxw+lEIg+oSIhGHaTfnyz19SG890mZyq9xiI0MLwV9CbpHKbeVWeINvAavTA 4ZTXk+2gVaicp+q24m/sptRFSXzN4g== =9L8N -----END PGP SIGNATURE----- --=-+Bh84uQvVAW6orY4FtDt--