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 B1568138334 for ; Thu, 26 Sep 2019 08:05:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A1ABCE0908; Thu, 26 Sep 2019 08:05:18 +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 315E7E08CA for ; Thu, 26 Sep 2019 08:05:18 +0000 (UTC) Received: from [10.12.14.180] (unknown [23.129.64.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: fordfrog@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 11F9034B5B4 for ; Thu, 26 Sep 2019 08:05:15 +0000 (UTC) Subject: Re: [gentoo-dev] RFC: ant-tasks.eclass patch To: gentoo-dev@lists.gentoo.org References: From: =?UTF-8?Q?Miroslav_=c5=a0ulc?= Message-ID: <776f2651-25b7-0de0-c0ea-58e5b27dd3dd@gentoo.org> Date: Thu, 26 Sep 2019 10:05:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 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 In-Reply-To: Content-Type: multipart/mixed; boundary="------------9A7D09AF4F99ECB5F29DD11D" Content-Language: en-US X-Archives-Salt: 95c4087a-c2c1-4136-80b4-677b2b0ab6c5 X-Archives-Hash: c7a0441db1d7b7333264948179e6c7f3 This is a multi-part message in MIME format. --------------9A7D09AF4F99ECB5F29DD11D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Dne 25. 09. 19 v 21:44 Michał Górny napsal(a): > On Wed, 2019-09-25 at 20:47 +0200, Miroslav Šulc wrote: >> ... > 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. thanks, you're right, i simplified the patch (attached) and all my tests passed. miroslav --------------9A7D09AF4F99ECB5F29DD11D Content-Type: text/x-patch; charset=UTF-8; name="ant-tasks.eclass.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ant-tasks.eclass.patch" diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass index 309df084d156..04c6fb5b7d67 100644 --- a/eclass/ant-tasks.eclass +++ b/eclass/ant-tasks.eclass @@ -54,7 +54,9 @@ ANT_TASK_NAME="${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=${ANT_TASK_DEPNAME-${ANT_TASK_NAME}} # @ECLASS-VARIABLE: ANT_TASK_DISABLE_VM_DEPS @@ -105,7 +107,7 @@ S="${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 @@ -129,9 +131,11 @@ 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} + for depname in "${ANT_TASK_DEPNAME[@]}"; do + java-pkg_jar-from ${depname} + done fi;; all) ant-tasks_src_unpack base jar-dep;; --------------9A7D09AF4F99ECB5F29DD11D--