aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlastimil Babka <caster@gentoo.org>2009-11-27 20:55:37 +0000
committerVlastimil Babka <caster@gentoo.org>2009-11-27 20:55:37 +0000
commite4da5b497df27980687a4b4105b095b57e2b34f9 (patch)
tree878081c4366b870627d17ae2ad08a3a8b02313f5
parentAdded buildonly support to java-vm.eselect, improved VersionManager and wrote... (diff)
downloadjava-config-e4da5b497df27980687a4b4105b095b57e2b34f9.tar.gz
java-config-e4da5b497df27980687a4b4105b095b57e2b34f9.tar.bz2
java-config-e4da5b497df27980687a4b4105b095b57e2b34f9.zip
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.
svn path=/projects/java-config-2/trunk/; revision=7989
-rw-r--r--src/java_config_2/EnvironmentManager.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/java_config_2/EnvironmentManager.py b/src/java_config_2/EnvironmentManager.py
index c62f957..10bfb7d 100644
--- a/src/java_config_2/EnvironmentManager.py
+++ b/src/java_config_2/EnvironmentManager.py
@@ -135,7 +135,10 @@ class EnvironmentManager(object):
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