Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/updater.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-07-22 13:13:22 +0300
committerGitHub <noreply@github.com>2019-07-22 13:13:22 +0300
commit96234eb99dd5b887350e63d1b0815a978395bf65 (patch)
tree491305a35732ef42dce022ae585e5cc5825253e6
parentb0891124389617d4e2c7fd7c03ad8041cc836cc0 (diff)
parent5c538f05440e07977f0cfab49bec7733450e4888 (diff)
Exclude .rnd files
-rw-r--r--index.php3
-rw-r--r--lib/RecursiveDirectoryIteratorWithoutData.php1
-rw-r--r--lib/Updater.php2
-rw-r--r--tests/features/bootstrap/FeatureContext.php8
-rw-r--r--tests/features/stable15.feature33
-rw-r--r--tests/features/stable16.feature2
-rwxr-xr-xupdater.pharbin599747 -> 599781 bytes
7 files changed, 45 insertions, 4 deletions
diff --git a/index.php b/index.php
index 99a52f9..2c4ac37 100644
--- a/index.php
+++ b/index.php
@@ -40,6 +40,7 @@ class RecursiveDirectoryIteratorWithoutData extends \RecursiveFilterIterator {
public function accept() {
/** @var \DirectoryIterator $this */
$excludes = [
+ '.rnd',
'.well-known',
'data',
'..',
@@ -318,6 +319,7 @@ class Updater {
'themes',
'updater',
// Files
+ '.rnd',
'index.html',
'indie.json',
'.user.ini',
@@ -461,6 +463,7 @@ class Updater {
$this->silentLog('[info] createBackup()');
$excludedElements = [
+ '.rnd',
'.well-known',
'data',
];
diff --git a/lib/RecursiveDirectoryIteratorWithoutData.php b/lib/RecursiveDirectoryIteratorWithoutData.php
index 3b9ae76..13f0a40 100644
--- a/lib/RecursiveDirectoryIteratorWithoutData.php
+++ b/lib/RecursiveDirectoryIteratorWithoutData.php
@@ -26,6 +26,7 @@ class RecursiveDirectoryIteratorWithoutData extends \RecursiveFilterIterator {
public function accept() {
/** @var \DirectoryIterator $this */
$excludes = [
+ '.rnd',
'.well-known',
'data',
'..',
diff --git a/lib/Updater.php b/lib/Updater.php
index d730e16..0434d87 100644
--- a/lib/Updater.php
+++ b/lib/Updater.php
@@ -202,6 +202,7 @@ class Updater {
'themes',
'updater',
// Files
+ '.rnd',
'index.html',
'indie.json',
'.user.ini',
@@ -345,6 +346,7 @@ class Updater {
$this->silentLog('[info] createBackup()');
$excludedElements = [
+ '.rnd',
'.well-known',
'data',
];
diff --git a/tests/features/bootstrap/FeatureContext.php b/tests/features/bootstrap/FeatureContext.php
index 31bfac4..722e3b6 100644
--- a/tests/features/bootstrap/FeatureContext.php
+++ b/tests/features/bootstrap/FeatureContext.php
@@ -249,6 +249,12 @@ WbRmf4trGwDdCA/kQ59LInfLR8KFfEiiOH2p2NijgXuWm49tdr7N1062diP4Dzwd
WlWfRoT8G5DDQPGdj5a72+sQLjf3ZhjqgeQbGLwht/NonWLZhmmW/NgmylbCb9Ob
a7NE4Vf792DrmBvq4HCHUexg+upaJ0s4sJLGqg3sWF8iUEnLyGePyL/Bw6MeLvjD
sSD0Xb5oawIjTVHVAuL+3Q==',
+ '15.0.10' => '1FcyXT8cgPMctfn+S5QLGbPrkeXEWyaIGh1T9mP7BHaF5AHamuAGDzk04FKHYB/e
+OylmXzDBE2w1LG5AOABAw3idwIJpfvH2dyi8tsBNdcGKY01DmMYEzn4y5i2r5Duv
+lRjhRfuk/MrjUOH1XkGO1xPI8zXp8eI7Y53jHswbUayJGszzgCKcuC6z+QEUkf7v
+p15duG8nbbF1c3CAh/dVsJ2AKKpcnLYJPC8UgGDXMtalSoPUv9QTWPrS7AqQRsVD
+7xJThvWdx3aSV3aKREBzw5ddHUAIEENQ0aBdabgAXbBZEfLrMMG2XaHtdXGLpQs8
+ypwcWVvLfYk9e+YEMdhMNg==',
'16.0.3' => 'TYiUB/+l2uXNpiHGuMhchHzzyMn8eiL2mzBD+fmwqUXU29UYK4FFvTbDEWWXxXF9
XeOXXBTkWltQ6A5K+nwFx4Phf4VPznaGn3U/1hsLSLBy9p9qqBMQdmDvCxl4dJmP
R0Ttz6sGcC1AsYwW2Q5Z1lywpmk1Ax5YcJesbjOFTU9HXIOI2s9YyPX4bP3L1rkH
@@ -382,8 +388,6 @@ b813iKq4+cn3CjTunREm6A==',
require $this->serverDir . 'nextcloud/version.php';
$installedVersion = join('.', $OC_Version);
- // Hack for version number mapping
- $installedVersion = str_replace(['9.1', '9.2'], ['10.0', '11.0'], $installedVersion);
if (strpos($installedVersion, $version) !== 0) {
throw new Exception('Version mismatch - Installed: ' . $installedVersion . ' Wanted: ' . $version);
diff --git a/tests/features/stable15.feature b/tests/features/stable15.feature
index 202d6ed..1b4ba20 100644
--- a/tests/features/stable15.feature
+++ b/tests/features/stable15.feature
@@ -1,4 +1,4 @@
-Feature: CLI updater - stable14 base
+Feature: CLI updater - stable15 base
Scenario: Update is available - 15.0.0 beta 1 to 15.0.0 RC 1
Given the current installed version is 15.0.0beta1
@@ -10,6 +10,37 @@ Feature: CLI updater - stable14 base
And maintenance mode should be off
And upgrade is not required
+ Scenario: Update is available but unexpected folder found - 15.0.9 to 15.0.10
+ Given the current installed version is 15.0.9
+ And there is an update to version 15.0.10 available
+ And there is a folder called "test123"
+ When the CLI updater is run
+ Then the return code should not be 0
+ And the output should contain "The following extra files have been found"
+ Then the installed version should be 15.0.9
+ And maintenance mode should be off
+ And upgrade is not required
+
+ Scenario: Update is available and .well-known folder exist - 15.0.9 to 15.0.10
+ Given the current installed version is 15.0.9
+ And there is an update to version 15.0.10 available
+ And there is a folder called ".well-known"
+ When the CLI updater is run successfully
+ And the output should contain "Update successful"
+ Then the installed version should be 15.0.10
+ And maintenance mode should be off
+ And upgrade is not required
+
+ Scenario: Update is available and .rnd file exist - 15.0.9 to 15.0.10
+ Given the current installed version is 15.0.9
+ And there is an update to version 15.0.10 available
+ And there is a folder called ".rnd"
+ When the CLI updater is run successfully
+ And the output should contain "Update successful"
+ Then the installed version should be 15.0.10
+ And maintenance mode should be off
+ And upgrade is not required
+
Scenario: Update is available - 15.0.0 to master daily
Given the current installed version is 15.0.0RC1
And PHP is at least in version 7.0
diff --git a/tests/features/stable16.feature b/tests/features/stable16.feature
index f153da6..5ed5e8e 100644
--- a/tests/features/stable16.feature
+++ b/tests/features/stable16.feature
@@ -1,4 +1,4 @@
-Feature: CLI updater - stable14 base
+Feature: CLI updater - stable16 base
Scenario: Update is available - 16.0.1 to 16.0.3
Given the current installed version is 16.0.0
diff --git a/updater.phar b/updater.phar
index 42f9cf8..d89ee4b 100755
--- a/updater.phar
+++ b/updater.phar
Binary files differ