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

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDean Ferreyra <dean@octw.com>2020-07-20 03:41:28 +0300
committerDean Ferreyra <dean@octw.com>2020-07-20 04:01:52 +0300
commitf53876d0a4273760314b8c17e0ebb1446da2f514 (patch)
treeadff7fad0941f0581b7f036d0e2a6b987a43a3e5 /Duplicati/CommandLine
parentf44428ea706281adc71110cf9855ab8626a3f8d0 (diff)
Fix Recovery Tool handling of paths with dashes
In Duplicati.CommandLine.RecoveryTool, the `index` and `list` commands do not recognize Duplicati backup files when those files are in paths containing dashes. For example, without this change, if you call ``` Duplicati.CommandLine.RecoveryTool index C:\Temp\duplicati-tests\recovery-tool\backup-files ``` the Duplicati backup files are displayed, but the recovery tool reports "Not a Duplicati file, ignoring" for each of them.
Diffstat (limited to 'Duplicati/CommandLine')
-rw-r--r--Duplicati/CommandLine/RecoveryTool/Index.cs2
-rw-r--r--Duplicati/CommandLine/RecoveryTool/List.cs6
2 files changed, 4 insertions, 4 deletions
diff --git a/Duplicati/CommandLine/RecoveryTool/Index.cs b/Duplicati/CommandLine/RecoveryTool/Index.cs
index c1835084a..0f47f61f7 100644
--- a/Duplicati/CommandLine/RecoveryTool/Index.cs
+++ b/Duplicati/CommandLine/RecoveryTool/Index.cs
@@ -64,7 +64,7 @@ namespace Duplicati.CommandLine.RecoveryTool
try
{
- var p = Library.Main.Volumes.VolumeBase.ParseFilename(file);
+ var p = Library.Main.Volumes.VolumeBase.ParseFilename(Path.GetFileName(file));
if (p == null)
{
Console.WriteLine(" - Not a Duplicati file, ignoring");
diff --git a/Duplicati/CommandLine/RecoveryTool/List.cs b/Duplicati/CommandLine/RecoveryTool/List.cs
index 346e5e765..5fe20eb50 100644
--- a/Duplicati/CommandLine/RecoveryTool/List.cs
+++ b/Duplicati/CommandLine/RecoveryTool/List.cs
@@ -51,7 +51,7 @@ namespace Duplicati.CommandLine.RecoveryTool
{
var file = SelectListFile(args[2], folder);
- var p = Library.Main.Volumes.VolumeBase.ParseFilename(file);
+ var p = Library.Main.Volumes.VolumeBase.ParseFilename(Path.GetFileName(file));
Library.Main.Volumes.VolumeReaderBase.UpdateOptionsFromManifest(p.CompressionModule, file, new Duplicati.Library.Main.Options(options));
@@ -64,7 +64,7 @@ namespace Duplicati.CommandLine.RecoveryTool
public static IEnumerable<Duplicati.Library.Main.Volumes.IFileEntry> EnumerateFilesInDList(string file, Duplicati.Library.Utility.IFilter filter, Dictionary<string, string> options)
{
- var p = Library.Main.Volumes.VolumeBase.ParseFilename(file);
+ var p = Library.Main.Volumes.VolumeBase.ParseFilename(Path.GetFileName(file));
using (var fs = new System.IO.FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
using (var cm = Library.DynamicLoader.CompressionLoader.GetModule(p.CompressionModule, fs, Library.Interface.ArchiveMode.Read, options))
using (var filesetreader = new Library.Main.Volumes.FilesetVolumeReader(cm, new Duplicati.Library.Main.Options(options)))
@@ -112,7 +112,7 @@ namespace Duplicati.CommandLine.RecoveryTool
{
return (
from v in Directory.EnumerateFiles(folder)
- let p = Library.Main.Volumes.VolumeBase.ParseFilename(v)
+ let p = Library.Main.Volumes.VolumeBase.ParseFilename(Path.GetFileName(v))
where p != null && p.FileType == Duplicati.Library.Main.RemoteVolumeType.Files
orderby p.Time descending
select new KeyValuePair<DateTime, string>(p.Time, v)).ToArray();