From: "Miroslav Šulc" <fordfrog@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] RFC: ant-tasks.eclass patch
Date: Thu, 26 Sep 2019 10:05:09 +0200 [thread overview]
Message-ID: <776f2651-25b7-0de0-c0ea-58e5b27dd3dd@gentoo.org> (raw)
In-Reply-To: <bbf22cdfb697213723379066aaa036f6f8fed4ed.camel@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 419 bytes --]
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
[-- Attachment #2: ant-tasks.eclass.patch --]
[-- Type: text/x-patch, Size: 1533 bytes --]
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;;
prev parent reply other threads:[~2019-09-26 8:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 18:47 [gentoo-dev] RFC: ant-tasks.eclass patch Miroslav Šulc
2019-09-25 19:44 ` Michał Górny
2019-09-26 8:05 ` Miroslav Šulc [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=776f2651-25b7-0de0-c0ea-58e5b27dd3dd@gentoo.org \
--to=fordfrog@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox