[Pkg-owncloud-commits] [owncloud] 14/61: Set version AFTER a successful update

David Prévot taffit at moszumanska.debian.org
Thu Jul 31 03:51:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 9cd741417ace87a4be7b37f57bdd5c122588505e
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed Jul 23 23:38:17 2014 +0200

    Set version AFTER a successful update
    
    If an app upgrade failed, the core version will not be increased either
    in the database. This will re-display the update page and make it
    possible to redo the apps upgrade.
    
    Note that any core repair routine must take into account that an update
    might need to be redone again even though the core's DB state is already
    the one of the new version.
---
 lib/private/updater.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/private/updater.php b/lib/private/updater.php
index d50c255..7acd644 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -212,8 +212,6 @@ class Updater extends BasicEmitter {
 			\OC_DB::updateDbFromStructure(\OC::$SERVERROOT . '/db_structure.xml');
 			$this->emit('\OC\Updater', 'dbUpgrade');
 
-			// TODO: why not do this at the end ?
-			\OC_Config::setValue('version', implode('.', \OC_Util::getVersion()));
 			$disabledApps = \OC_App::checkAppsRequirements();
 			if (!empty($disabledApps)) {
 				$this->emit('\OC\Updater', 'disabledApps', array($disabledApps));
@@ -227,6 +225,9 @@ class Updater extends BasicEmitter {
 
 			//Invalidate update feed
 			\OC_Appconfig::setValue('core', 'lastupdatedat', 0);
+
+			// only set the final version if everything went well
+			\OC_Config::setValue('version', implode('.', \OC_Util::getVersion()));
 		}
 	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list