[Pkg-owncloud-commits] [owncloud] 96/457: Skip disable3rdParty Apps

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:05:35 UTC 2015


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

taffit pushed a commit to branch stable8
in repository owncloud.

commit 48040c46cb6ebcfbe6e7070d82e411be4ed12d2e
Author: Steffen Lindner <mail at steffen-lindner.de>
Date:   Wed May 20 17:06:00 2015 +0200

    Skip disable3rdParty Apps
---
 core/command/upgrade.php | 14 ++++++++++++--
 lib/private/updater.php  | 23 +++++++++++++++++++----
 2 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/core/command/upgrade.php b/core/command/upgrade.php
index 7f5d943..85bd430 100644
--- a/core/command/upgrade.php
+++ b/core/command/upgrade.php
@@ -70,6 +70,12 @@ class Upgrade extends Command {
 				null,
 				InputOption::VALUE_NONE,
 				'only runs the database schema migration simulation, do not actually update'
+			)
+			->addOption(
+				'--no-app-disable',
+				null,
+				InputOption::VALUE_NONE,
+				'skips the disable of third party apps'
 			);
 	}
 
@@ -83,6 +89,7 @@ class Upgrade extends Command {
 
 		$simulateStepEnabled = true;
 		$updateStepEnabled = true;
+		$skip3rdPartyAppsDisable = false;
 
 		if ($input->getOption('skip-migration-test')) {
 			$simulateStepEnabled = false;
@@ -90,6 +97,9 @@ class Upgrade extends Command {
 	   	if ($input->getOption('dry-run')) {
 			$updateStepEnabled = false;
 		}
+		if ($input->getOption('no-app-disable')) {
+			$skip3rdPartyAppsDisable = true;
+		}
 
 		if (!$simulateStepEnabled && !$updateStepEnabled) {
 			$output->writeln(
@@ -106,6 +116,7 @@ class Upgrade extends Command {
 
 			$updater->setSimulateStepEnabled($simulateStepEnabled);
 			$updater->setUpdateStepEnabled($updateStepEnabled);
+			$updater->setSkip3rdPartyAppsDisable($skip3rdPartyAppsDisable);
 
 			$updater->listen('\OC\Updater', 'maintenanceStart', function () use($output) {
 				$output->writeln('<info>Turned on maintenance mode</info>');
@@ -127,7 +138,7 @@ class Upgrade extends Command {
 			$updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use($output) {
 				$output->writeln('<info>Disabled incompatible app: ' . $app . '</info>');
 			});
-			$updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use($output) {
+			$updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use ($output) {
 				$output->writeln('<info>Disabled 3rd-party app: ' . $app . '</info>');
 			});
 			$updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use($output) {
@@ -145,7 +156,6 @@ class Upgrade extends Command {
 			$updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($output) {
 				$output->writeln("<info>Updated <$app> to $version</info>");
 			});
-
 			$updater->listen('\OC\Updater', 'failure', function ($message) use($output, $self) {
 				$output->writeln("<error>$message</error>");
 				$self->upgradeFailed = true;
diff --git a/lib/private/updater.php b/lib/private/updater.php
index 59b1c0a..8371193 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -65,6 +65,9 @@ class Updater extends BasicEmitter {
 	/** @var bool */
 	private $updateStepEnabled;
 
+	/** @var bool */
+	private $skip3rdPartyAppsDisable;
+
 	/**
 	 * @param HTTPHelper $httpHelper
 	 * @param IConfig $config
@@ -100,6 +103,16 @@ class Updater extends BasicEmitter {
 	}
 
 	/**
+	 * Sets whether the update disables 3rd party apps.
+	 * This can be set to true to skip the disable.
+	 *
+	 * @param bool $flag false to not disable, true otherwise
+	 */
+	public function setSkip3rdPartyAppsDisable($flag) {
+		$this->skip3rdPartyAppsDisable = $flag;
+	}
+
+	/**
 	 * Check if a new version is available
 	 *
 	 * @param string $updaterUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
@@ -407,10 +420,12 @@ class Updater extends BasicEmitter {
 				continue;
 			}
 
-			// disable any other 3rd party apps
-			\OC_App::disable($app);
-			$disabledApps[]= $app;
-			$this->emit('\OC\Updater', 'thirdPartyAppDisabled', array($app));
+			// disable any other 3rd party apps if not overriden
+			if(!$this->skip3rdPartyAppsDisable) {
+				\OC_App::disable($app);
+				$disabledApps[]= $app;
+				$this->emit('\OC\Updater', 'thirdPartyAppDisabled', array($app));
+			};
 		}
 		return $disabledApps;
 	}

-- 
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