From f74572e92d888329122e37286a95f4bc85b77763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 27 Jun 2017 21:30:31 +0200 Subject: [PATCH 1/5] [stable10] enterprise_key is not longer a shipped app --- core/shipped.json | 1 - 1 file changed, 1 deletion(-) diff --git a/core/shipped.json b/core/shipped.json index 717e433e017c..eb514f733b3a 100644 --- a/core/shipped.json +++ b/core/shipped.json @@ -3,7 +3,6 @@ "encryption", "configreport", "dav", - "enterprise_key", "federation", "federatedfilesharing", "files", From 19a198d3b0d9251d1b951fb16e7e035140a7d1af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 27 Jun 2017 21:31:00 +0200 Subject: [PATCH 2/5] No app inf? App is not installed -> bye bye --- lib/private/legacy/app.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 4507e8bc292a..9f48dcb9c682 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -359,6 +359,9 @@ public static function enable($app, $groups = null) { $config = \OC::$server->getConfig(); $l = \OC::$server->getL10N('core'); $info = self::getAppInfo($app); + if ($info === null) { + throw new \Exception("$app can't be enabled since it is not installed."); + } self::checkAppDependencies($config, $l, $info); From 6f9a1055ab90abf626d2826ed8668b53099086bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 27 Jun 2017 22:10:57 +0200 Subject: [PATCH 3/5] Use correct path when uninstalling an app --- lib/private/Installer.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 2ebeda117b42..e56604d2f282 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -429,16 +429,17 @@ public static function isDownloaded( $name ) { public static function removeApp($appId) { if(Installer::isDownloaded( $appId )) { - $appDir=OC_App::getInstallPath() . '/' . $appId; + $appDir = OC_App::getAppPath($appId); + if ($appDir === false) { + return false; + } OC_Helper::rmdirr($appDir); return true; - }else{ - \OCP\Util::writeLog('core', 'can\'t remove app '.$appId.'. It is not installed.', \OCP\Util::ERROR); - - return false; } + \OCP\Util::writeLog('core', 'can\'t remove app '.$appId.'. It is not installed.', \OCP\Util::ERROR); + return false; } /** From 0769a6d3a5a4b8a0dde146a29f68eacdf0c6b816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 27 Jun 2017 22:14:04 +0200 Subject: [PATCH 4/5] We better not delete a git clone --- lib/private/Installer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/private/Installer.php b/lib/private/Installer.php index e56604d2f282..a41ac1e1dc80 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -433,6 +433,10 @@ public static function removeApp($appId) { if ($appDir === false) { return false; } + if(is_dir("$appDir/.git")) { + throw new AppAlreadyInstalledException("App <$appId> is a git clone - it will not be deleted."); + } + OC_Helper::rmdirr($appDir); return true; From c97b3f567a5cf49ff5f497b96b58dd5d8806624e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 27 Jun 2017 22:44:23 +0200 Subject: [PATCH 5/5] Add optional parameter to IAppManager::installApp --- lib/public/App/IAppManager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index f2f24cff63b1..b6d64aa4d920 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -116,10 +116,11 @@ public function getAlwaysEnabledApps(); /** * @param string $package + * @param bool $skipMigrations whether to skip migrations, which would only install the code * @return mixed * @since 10.0 */ - public function installApp($package); + public function installApp($package, $skipMigrations = false); /** * @param string $package