From daa4c66e7fa636173330694d7d5be140c4a74a6a Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 5 Jun 2017 18:06:00 +0200 Subject: [PATCH] Do not perform automatic updates for major platform version --- src/cron.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cron.js b/src/cron.js index f9c43f528..b5fb4dc9c 100644 --- a/src/cron.js +++ b/src/cron.js @@ -19,6 +19,7 @@ var apps = require('./apps.js'), janitor = require('./janitor.js'), scheduler = require('./scheduler.js'), settings = require('./settings.js'), + semver = require('semver'), updateChecker = require('./updatechecker.js'); var gAutoupdaterJob = null, @@ -189,8 +190,12 @@ function autoupdatePatternChanged(pattern) { onTick: function() { var updateInfo = updateChecker.getUpdateInfo(); if (updateInfo.box) { - debug('Starting autoupdate to %j', updateInfo.box); - cloudron.updateToLatest(AUDIT_SOURCE, NOOP_CALLBACK); + if (semver.major(updateInfo.version) === semver.major(config.version())) { + debug('Starting autoupdate to %j', updateInfo.box); + cloudron.updateToLatest(AUDIT_SOURCE, NOOP_CALLBACK); + } else { + debug('Block automatic update for major version'); + } } else if (updateInfo.apps) { debug('Starting app update to %j', updateInfo.apps); apps.updateApps(updateInfo.apps, AUDIT_SOURCE, NOOP_CALLBACK);