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
This commit is contained in:
Kenneth Skovhede
2018-06-30 17:28:23 +02:00
parent 3251d0f56c
commit 355ef920ea
2 changed files with 7 additions and 2 deletions
@@ -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<string, long>();
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;
+5
View File
@@ -1457,6 +1457,11 @@ namespace Duplicati.Library.Main
}
}
/// <summary>
/// Gets a value indicating whether a blocksize has been specified
/// </summary>
public bool HasBlocksize { get { return m_options.ContainsKey("blocksize") && !string.IsNullOrEmpty(m_options["blocksize"]); } }
/// <summary>
/// Gets the size of file-blocks
/// </summary>