Gentoo Archives: gentoo-java

From: Alistair Bush <ali_bush@g.o>
To: gentoo-java@l.g.o
Subject: [gentoo-java] Bug 225659: java-pkg_jarfrom --virtual virtual-name jarname.jar fails with JVM providers.
Date: Wed, 29 Apr 2009 11:31:26
Message-Id: 49F83A4A.6060907@gentoo.org
1 I would like the discuss the solutions to bug 225659 [1]
2
3 When using jar-from with a virtual that can return both a jar or a "vm
4 provider" there is no way to specify a target_jar when calling jar from.
5 basically jar-from calls java-config -p virtual with may or may not
6 return a string with paths to jars within it. In the case of there
7 being a vm provider java-config will return an empty string. Currently
8 jar-from errors as it is unable to find the target_jar from returned
9 string and is therefore unable to link to that jar.
10
11 Now we can fix this issue but simply ignoring the fact that we didn't
12 find the target_jar when --virtual is specified. Basically see [2].
13 This will therefore never error, even when the virtual does not have vm
14 providers and is only ever satisfied by a package.
15 as an example
16
17 java-pkg_jar-from --virtual javamail
18 target_vm_which_is_not_provided_by_anything.jar
19
20 would not error, it also wouldn't create the link it is meant to.
21
22 So Questions:
23
24 Should jar-from maintain its current behavour?
25 Are there any other solutions to this issue?
26 Any other comments?
27
28 [1] https://bugs.gentoo.org/225659
29
30 [2]
31 Index: java-utils-2.eclass
32 ===================================================================
33 RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v
34 retrieving revision 1.126
35 diff -u -b -B -r1.126 java-utils-2.eclass
36 --- java-utils-2.eclass 31 Mar 2009 19:19:20 -0000 1.126
37 +++ java-utils-2.eclass 29 Apr 2009 11:13:07 -0000
38 @@ -965,9 +965,10 @@
39 if [[ -z "${target_jar}" ]] ; then
40 return 0
41 # otherwise, die bitterly
42 - else
43 + elif [[ ! -z "${virtual}" ]]
44 die "Failed to find ${target_jar:-jar} in ${target_pkg}"
45 fi
46 + return 0
47 }
48
49 #
50 ------------------------------------------------------------------------------