From 33e3a62227f13c7395f5e940760b607c02a98a02 Mon Sep 17 00:00:00 2001 From: Tom Needham Date: Mon, 15 Jan 2018 12:44:53 +0000 Subject: [PATCH 1/2] Store the origin version during installation --- core/Command/Status.php | 3 ++- lib/private/Setup.php | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/Command/Status.php b/core/Command/Status.php index f06b26982075..87e1f074efc3 100644 --- a/core/Command/Status.php +++ b/core/Command/Status.php @@ -40,7 +40,8 @@ protected function configure() { protected function execute(InputInterface $input, OutputInterface $output) { $values = [ 'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false), - 'version' => implode('.', \OCP\Util::getVersion()), + 'first_install_version' => \OC::$server->getConfig()->getAppValue('core', 'first_install_version', 'unknown'), + 'version' => \implode('.', \OCP\Util::getVersion()), 'versionstring' => \OC_Util::getVersionString(), 'edition' => \OC_Util::getEditionString(), ]; diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 76bbe6b1a886..336339e445e2 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -380,6 +380,9 @@ public function install($options) { self::installBackgroundJobs(); + // save the origin version that we installed at + $config->setAppValue('core', 'first_install_version', \implode('.', \OCP\Util::getVersion())); + //and we are done $config->setSystemValue('installed', true); } From 666ba5f335f213622f4667e3979eafb1ce1e1b1f Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 2 Feb 2018 19:22:06 +0545 Subject: [PATCH 2/2] Adjust parsing occ status command output due to new first_install_version line --- tests/acceptance/features/bootstrap/BasicStructure.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/features/bootstrap/BasicStructure.php b/tests/acceptance/features/bootstrap/BasicStructure.php index 1b93d9c525db..0059dc53520d 100644 --- a/tests/acceptance/features/bootstrap/BasicStructure.php +++ b/tests/acceptance/features/bootstrap/BasicStructure.php @@ -923,11 +923,11 @@ public function statusPhpRespondedShouldMatch(PyStringNode $jsonExpected) { = \json_encode(\json_decode($this->response->getBody(), true)); if ($this->runOcc(['status']) === 0) { $output = \explode("- ", $this->lastStdOut); - $version = \explode(": ", $output[2]); + $version = \explode(": ", $output[3]); PHPUnit_Framework_Assert::assertEquals( "version", $version[0] ); - $versionString = \explode(": ", $output[3]); + $versionString = \explode(": ", $output[4]); PHPUnit_Framework_Assert::assertEquals( "versionstring", $versionString[0] );