Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 288695 - dev-java/java-config VM matching in jdk.conf is too loose, cannot prefer icedtea6 when icedtea6-bin is also installed
Summary: dev-java/java-config VM matching in jdk.conf is too loose, cannot prefer iced...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 294029
  Show dependency tree
 
Reported: 2009-10-12 08:27 UTC by Vlastimil Babka (Caster) (RETIRED)
Modified: 2009-12-22 23:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-10-12 08:27:39 UTC
Got this in /etc/java-config-2/build/jdk.conf
*=icedtea6 sun-jdk

But icedtea6-bin is selected. I assume that the matching in java-config is just matching substring and it can happen that icedtea6-bin gets picked first.
The problem is that icedtea6 does not have a version appended, icedtea-1.6 vs icedtea6-bin-1.6 would be easier to distinguish. But that's how it is :/
The matching will thus have to be a bit more complicated:
- try to match exact string first
- if nothing found, match substring/prefix (so 'sun-jdk' still works) and get the highest available matching version (that's how it is now, I suppose)

Same goes for jdk-defaults.conf (guess it's the same code?) As I'd like to put icedtea6 and icedtea6-bin to the defaults for bug 287794, this should be sorted out.
Comment 1 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-11-27 21:00:08 UTC
Hopefully fixed in SVN.

------------------------------------------------------------------------
r7989 | caster | 2009-11-27 21:55:37 +0100 (Fri, 27 Nov 2009) | 1 line

Change VM matching to fix bug #288695, a user preference is not matched as a simple prefix of VMHANDLE anymore, but has to be either an exact VMHANDLE match or match VMHANDLE after -SLOT appended. A icedtea6 preference will thus no longer match icedtea6-bin.

--- src/java_config_2/EnvironmentManager.py     (revision 7988)
+++ src/java_config_2/EnvironmentManager.py     (revision 7989)
@@ -135,7 +135,10 @@
     def find_vm(self, name):
         found = []
         for id, vm in self.get_virtual_machines().iteritems():
-            if vm.name().startswith(name):
+            # match either exact given string or the unversioned part - bug #288695
+            if vm.name() == name:
+                found.append(vm)
+            elif vm.name() == (name + "-" + vm.version()):
                 found.append(vm)
         return found
Comment 2 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-12-22 23:19:02 UTC
Released in 2.1.10