From d422875ae4e5e6afc425367d2ff710074fd154a6 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 21 Jun 2017 16:50:20 -0500 Subject: [PATCH] Run repair step only once Signed-off-by: Morris Jobke --- lib/composer/composer/autoload_classmap.php | 1 + lib/composer/composer/autoload_static.php | 1 + lib/private/Repair.php | 2 +- lib/private/Repair/{ => NC13}/RepairInvalidPaths.php | 10 +++++++--- version.php | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) rename lib/private/Repair/{ => NC13}/RepairInvalidPaths.php (91%) diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 5a77bb7fd41..c85cde55df8 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -740,6 +740,7 @@ return array( 'OC\\Repair\\NC11\\MoveAvatarsBackgroundJob' => $baseDir . '/lib/private/Repair/NC11/MoveAvatarsBackgroundJob.php', 'OC\\Repair\\NC12\\InstallCoreBundle' => $baseDir . '/lib/private/Repair/NC12/InstallCoreBundle.php', 'OC\\Repair\\NC12\\UpdateLanguageCodes' => $baseDir . '/lib/private/Repair/NC12/UpdateLanguageCodes.php', + 'OC\\Repair\\NC13\\RepairInvalidPaths' => $baseDir . '/lib/private/Repair/NC13/RepairInvalidPaths.php', 'OC\\Repair\\OldGroupMembershipShares' => $baseDir . '/lib/private/Repair/OldGroupMembershipShares.php', 'OC\\Repair\\Owncloud\\SaveAccountsTableData' => $baseDir . '/lib/private/Repair/Owncloud/SaveAccountsTableData.php', 'OC\\Repair\\RemoveRootShares' => $baseDir . '/lib/private/Repair/RemoveRootShares.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 97875daaa62..3483911451a 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -770,6 +770,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Repair\\NC11\\MoveAvatarsBackgroundJob' => __DIR__ . '/../../..' . '/lib/private/Repair/NC11/MoveAvatarsBackgroundJob.php', 'OC\\Repair\\NC12\\InstallCoreBundle' => __DIR__ . '/../../..' . '/lib/private/Repair/NC12/InstallCoreBundle.php', 'OC\\Repair\\NC12\\UpdateLanguageCodes' => __DIR__ . '/../../..' . '/lib/private/Repair/NC12/UpdateLanguageCodes.php', + 'OC\\Repair\\NC13\\RepairInvalidPaths' => __DIR__ . '/../../..' . '/lib/private/Repair/NC13/RepairInvalidPaths.php', 'OC\\Repair\\OldGroupMembershipShares' => __DIR__ . '/../../..' . '/lib/private/Repair/OldGroupMembershipShares.php', 'OC\\Repair\\Owncloud\\SaveAccountsTableData' => __DIR__ . '/../../..' . '/lib/private/Repair/Owncloud/SaveAccountsTableData.php', 'OC\\Repair\\RemoveRootShares' => __DIR__ . '/../../..' . '/lib/private/Repair/RemoveRootShares.php', diff --git a/lib/private/Repair.php b/lib/private/Repair.php index ca8dbd98758..65b131169f7 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -42,7 +42,7 @@ use OC\Repair\NC12\UpdateLanguageCodes; use OC\Repair\OldGroupMembershipShares; use OC\Repair\Owncloud\SaveAccountsTableData; use OC\Repair\RemoveRootShares; -use OC\Repair\RepairInvalidPaths; +use OC\Repair\NC13\RepairInvalidPaths; use OC\Repair\SqliteAutoincrement; use OC\Repair\RepairMimeTypes; use OC\Repair\RepairInvalidShares; diff --git a/lib/private/Repair/RepairInvalidPaths.php b/lib/private/Repair/NC13/RepairInvalidPaths.php similarity index 91% rename from lib/private/Repair/RepairInvalidPaths.php rename to lib/private/Repair/NC13/RepairInvalidPaths.php index cdd0906295f..8551f8261e2 100644 --- a/lib/private/Repair/RepairInvalidPaths.php +++ b/lib/private/Repair/NC13/RepairInvalidPaths.php @@ -19,7 +19,7 @@ * */ -namespace OC\Repair; +namespace OC\Repair\NC13; use OCP\IDBConnection; @@ -114,8 +114,12 @@ class RepairInvalidPaths implements IRepairStep { } public function run(IOutput $output) { - $count = $this->repair(); + $versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0'); + // was added to 12.0.0.30 and 13.0.0.1 + if (version_compare($versionFromBeforeUpdate, '12.0.0.30', '<') || version_compare($versionFromBeforeUpdate, '13.0.0.0', '==')) { + $count = $this->repair(); - $output->info('Repaired ' . $count . ' paths'); + $output->info('Repaired ' . $count . ' paths'); + } } } diff --git a/version.php b/version.php index 53c14a23ab3..3a14aaee735 100644 --- a/version.php +++ b/version.php @@ -26,7 +26,7 @@ // between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel // when updating major/minor version number. -$OC_Version = array(12, 0, 0, 29); +$OC_Version = array(12, 0, 0, 30); // The human readable string $OC_VersionString = '12.0.0'; -- 2.39.5