Skip to content
Permalink
Browse files

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
  • Loading branch information...
kenkendk committed Jun 30, 2018
1 parent 3251d0f commit 355ef920ea531e2c11a2b79c6a9be04c8c0af896
@@ -92,7 +92,7 @@ internal void DoRun(LocalDatabase dbparent, bool updating, Library.Utility.IFilt
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 @@ internal void DoRun(LocalDatabase dbparent, bool updating, Library.Utility.IFilt

var parsed = VolumeBase.ParseFilename(entry.Name);

if (!hasUpdatedOptions && !updating)
if (!hasUpdatedOptions && (!updating || autoDetectBlockSize))
{
VolumeReaderBase.UpdateOptionsFromManifest(parsed.CompressionModule, tmpfile, m_options);
hasUpdatedOptions = true;
@@ -1457,6 +1457,11 @@ public string Dbpath
}
}

/// <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>

3 comments on commit 355ef92

@duplicatibot

This comment has been minimized.

Copy link

replied Jun 30, 2018

This commit has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/2nd-beta-version-of-duplicati-2-0-now-available/3085/18

@duplicatibot

This comment has been minimized.

Copy link

replied Feb 28, 2019

@duplicatibot

This comment has been minimized.

Copy link

replied Jun 10, 2019

This commit has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/restores-on-non-standard-parameters/7235/2

Please sign in to comment.
You can’t perform that action at this time.