summaryrefslogtreecommitdiff
path: root/BKUWebStart/src/main
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-06-25 18:25:56 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-06-25 18:25:56 +0000
commit60a139378e88719445a0958cadd4271dd5e2d6bc (patch)
tree8b0bee739d10d30a51d34feb7493aa79732822a0 /BKUWebStart/src/main
parente75f30d8d51fa33fc778c31c1b0312cf10de8e45 (diff)
downloadmocca-60a139378e88719445a0958cadd4271dd5e2d6bc.tar.gz
mocca-60a139378e88719445a0958cadd4271dd5e2d6bc.tar.bz2
mocca-60a139378e88719445a0958cadd4271dd5e2d6bc.zip
account for snapshot version in update conf
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@377 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'BKUWebStart/src/main')
-rw-r--r--BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java
index 5e4ab634..abc0b8ee 100644
--- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java
+++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/BKULauncher.java
@@ -152,11 +152,19 @@ public class BKULauncher implements BKUControllerInterface {
*/
private boolean updateRequired(String oldVersion, String newVersion) {
if (oldVersion != null) {
+ log.debug("comparing " + oldVersion + " to " + MIN_CONFIG_VERSION);
+
int majorEnd = oldVersion.indexOf('-');
- if (majorEnd > 0) {
- oldVersion = oldVersion.substring(0, majorEnd);
+ String oldMajor = (majorEnd < 0) ? oldVersion : oldVersion.substring(0, majorEnd);
+
+ int compare = oldMajor.compareTo(MIN_CONFIG_VERSION);
+ if (compare < 0 ||
+ // SNAPSHOT versions are pre-releases (update if release required)
+ (compare == 0 && oldVersion.startsWith("-SNAPSHOT", majorEnd))) {
+ return true;
+ } else {
+ return false;
}
- return (oldVersion.compareTo(MIN_CONFIG_VERSION) < 0);
}
log.debug("no old version, update required");
return true;