diff --git a/core/src/main/groovy/com/muwire/core/update/UpdateClient.groovy b/core/src/main/groovy/com/muwire/core/update/UpdateClient.groovy index c89362bd..774af700 100644 --- a/core/src/main/groovy/com/muwire/core/update/UpdateClient.groovy +++ b/core/src/main/groovy/com/muwire/core/update/UpdateClient.groovy @@ -152,8 +152,31 @@ class UpdateClient { } if (VersionComparator.comp(myVersion, payload.version) >= 0) { - log.info("no new version available") - return + + String beta = System.getProperty("beta") + + if (beta == null) { + log.info("no new version available") + return + } + + if (payload.beta == null) { + log.warning("no beta field in update payload") + return + } + + payload = payload.beta + + if (payload.version == null) { + log.warning("version missing in beta payload") + } + + int myBeta = Integer.parseInt(beta) + int updateBeta = Integer.parseInt(payload.version) + if (myBeta >= updateBeta) { + log.info("no new beta version available") + return + } } String infoHash diff --git a/gui/griffon-app/lifecycle/Ready.groovy b/gui/griffon-app/lifecycle/Ready.groovy index 9f0efba0..516d277d 100644 --- a/gui/griffon-app/lifecycle/Ready.groovy +++ b/gui/griffon-app/lifecycle/Ready.groovy @@ -39,6 +39,10 @@ class Ready extends AbstractLifecycleHandler { @Override void execute() { log.info "starting core services" + + String beta = metadata["application.beta"] + if (beta != null && beta != "0") + System.setProperty("beta", beta) def home = new File(application.getContext().getAsString("muwire-home")) def props = new Properties() @@ -103,7 +107,7 @@ class Ready extends AbstractLifecycleHandler { Core core try { - core = new Core(props, home, metadata["application.version"]) + core = new Core(props, home, metadata["application.coreVversion"]) Runtime.getRuntime().addShutdownHook({ core.shutdown() }) diff --git a/gui/griffon-app/resources/application.properties b/gui/griffon-app/resources/application.properties index c212f3f7..f69df289 100644 --- a/gui/griffon-app/resources/application.properties +++ b/gui/griffon-app/resources/application.properties @@ -1,6 +1,15 @@ application.name=MuWire + +# this version is for display purposes only application.version=0.8.12 + +# set this to 0 if this is not a beta application.beta=2 + +# this is the version the core gets initialized with +application.coreVersion=0.8.11 + + build.date=${build_date} build.time=${build_time} build.revision=${build_revision}