From 355ef920ea531e2c11a2b79c6a9be04c8c0af896 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sat, 30 Jun 2018 17:28:23 +0200 Subject: [PATCH] Fixed the code to allow reading various parameters from the manifest when restoring the database. This change ensures that the update happens, even when creating a partial database as the GUI does. This fixes #2323 --- Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs | 4 ++-- Duplicati/Library/Main/Options.cs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs b/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs index acc463278..dcb0ffe3f 100644 --- a/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs +++ b/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs @@ -92,7 +92,7 @@ namespace Duplicati.Library.Main.Operation using(var backend = new BackendManager(m_backendurl, m_options, m_result.BackendWriter, restoredb)) { restoredb.RepairInProgress = true; - + var autoDetectBlockSize = !(m_options.HasBlocksize && restoredb.GetDbOptions().ContainsKey("blocksize")); var volumeIds = new Dictionary(); var rawlist = backend.List(); @@ -205,7 +205,7 @@ namespace Duplicati.Library.Main.Operation var parsed = VolumeBase.ParseFilename(entry.Name); - if (!hasUpdatedOptions && !updating) + if (!hasUpdatedOptions && (!updating || autoDetectBlockSize)) { VolumeReaderBase.UpdateOptionsFromManifest(parsed.CompressionModule, tmpfile, m_options); hasUpdatedOptions = true; diff --git a/Duplicati/Library/Main/Options.cs b/Duplicati/Library/Main/Options.cs index 71d998fa6..60760a8c1 100644 --- a/Duplicati/Library/Main/Options.cs +++ b/Duplicati/Library/Main/Options.cs @@ -1457,6 +1457,11 @@ namespace Duplicati.Library.Main } } + /// + /// Gets a value indicating whether a blocksize has been specified + /// + public bool HasBlocksize { get { return m_options.ContainsKey("blocksize") && !string.IsNullOrEmpty(m_options["blocksize"]); } } + /// /// Gets the size of file-blocks ///