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:
Diffstat (limited to 'Duplicati/Library/Snapshots')
-rw-r--r--Duplicati/Library/Snapshots/Duplicati.Library.Snapshots.csproj2
-rw-r--r--Duplicati/Library/Snapshots/LinuxSnapshot.cs6
-rw-r--r--Duplicati/Library/Snapshots/NoSnapshot.cs16
-rw-r--r--Duplicati/Library/Snapshots/NoSnapshotWindows.cs8
-rw-r--r--Duplicati/Library/Snapshots/WindowsSnapshot.cs2
5 files changed, 18 insertions, 16 deletions
diff --git a/Duplicati/Library/Snapshots/Duplicati.Library.Snapshots.csproj b/Duplicati/Library/Snapshots/Duplicati.Library.Snapshots.csproj
index 7c5465e97..86708b640 100644
--- a/Duplicati/Library/Snapshots/Duplicati.Library.Snapshots.csproj
+++ b/Duplicati/Library/Snapshots/Duplicati.Library.Snapshots.csproj
@@ -48,6 +48,8 @@
<Reference Include="UnixSupport">
<HintPath>..\..\..\thirdparty\UnixSupport\UnixSupport.dll</HintPath>
</Reference>
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="DefineDosDevice.cs" />
diff --git a/Duplicati/Library/Snapshots/LinuxSnapshot.cs b/Duplicati/Library/Snapshots/LinuxSnapshot.cs
index 6f967c3d6..037f22db6 100644
--- a/Duplicati/Library/Snapshots/LinuxSnapshot.cs
+++ b/Duplicati/Library/Snapshots/LinuxSnapshot.cs
@@ -68,7 +68,7 @@ namespace Duplicati.Library.Snapshots
public SnapShot(string path)
{
m_name = string.Format("duplicati-{0}", Guid.NewGuid().ToString());
- m_realDir = Utility.Utility.AppendDirSeparator(path);
+ m_realDir = System.IO.Directory.Exists(path) ? Utility.Utility.AppendDirSeparator(path) : path;
GetVolumeName(m_realDir);
}
@@ -261,7 +261,7 @@ namespace Duplicati.Library.Snapshots
/// </summary>
/// <param name="folders">The list of folders to create snapshots for</param>
/// <param name="options">A set of commandline options</param>
- public LinuxSnapshot(string[] folders, Dictionary<string, string> options)
+ public LinuxSnapshot(string[] sources, Dictionary<string, string> options)
{
try
{
@@ -269,7 +269,7 @@ namespace Duplicati.Library.Snapshots
//Make sure we do not create more snapshots than we have to
Dictionary<string, SnapShot> snaps = new Dictionary<string, SnapShot>();
- foreach (string s in folders)
+ foreach (string s in sources)
{
SnapShot sn = new SnapShot(s);
if (!snaps.ContainsKey(sn.DeviceName))
diff --git a/Duplicati/Library/Snapshots/NoSnapshot.cs b/Duplicati/Library/Snapshots/NoSnapshot.cs
index 528bb5e37..e9ede2e4e 100644
--- a/Duplicati/Library/Snapshots/NoSnapshot.cs
+++ b/Duplicati/Library/Snapshots/NoSnapshot.cs
@@ -35,7 +35,7 @@ namespace Duplicati.Library.Snapshots
/// <summary>
/// The list of all folders in the snapshot
/// </summary>
- protected string[] m_sourcefolders;
+ protected string[] m_sources;
/// <summary>
/// A frequently used char-as-string
@@ -46,8 +46,8 @@ namespace Duplicati.Library.Snapshots
/// Constructs a new backup snapshot, using all the required disks
/// </summary>
/// <param name="sourcepaths">The folders that are about to be backed up</param>
- public NoSnapshot(string[] folders)
- : this(folders, new Dictionary<string, string>())
+ public NoSnapshot(string[] sources)
+ : this(sources, new Dictionary<string, string>())
{
}
@@ -56,11 +56,11 @@ namespace Duplicati.Library.Snapshots
/// </summary>
/// <param name="folders">The folders that are about to be backed up</param>
/// <param name="options">A set of system options</param>
- public NoSnapshot(string[] folders, Dictionary<string, string> options)
+ public NoSnapshot(string[] sources, Dictionary<string, string> options)
{
- m_sourcefolders = new string[folders.Length];
- for (int i = 0; i < m_sourcefolders.Length; i++)
- m_sourcefolders[i] = Utility.Utility.AppendDirSeparator(folders[i]);
+ m_sources = new string[sources.Length];
+ for (int i = 0; i < m_sources.Length; i++)
+ m_sources[i] = System.IO.Directory.Exists(sources[i]) ? Utility.Utility.AppendDirSeparator(sources[i]) : sources[i];
}
#region Private Methods
@@ -101,7 +101,7 @@ namespace Duplicati.Library.Snapshots
/// <param name="callback">The callback to invoke with each found path</param>
public IEnumerable<string> EnumerateFilesAndFolders(Duplicati.Library.Utility.Utility.EnumerationFilterDelegate callback)
{
- return m_sourcefolders.SelectMany(
+ return m_sources.SelectMany(
s => Utility.Utility.EnumerateFileSystemEntries(s, callback, this.ListFolders, this.ListFiles, this.GetAttributes)
);
}
diff --git a/Duplicati/Library/Snapshots/NoSnapshotWindows.cs b/Duplicati/Library/Snapshots/NoSnapshotWindows.cs
index e6d935358..9635bfce1 100644
--- a/Duplicati/Library/Snapshots/NoSnapshotWindows.cs
+++ b/Duplicati/Library/Snapshots/NoSnapshotWindows.cs
@@ -29,13 +29,13 @@ namespace Duplicati.Library.Snapshots
{
private SystemIOWindows m_sysIO = new SystemIOWindows();
- public NoSnapshotWindows(string[] sourcefolders)
- : base(sourcefolders)
+ public NoSnapshotWindows(string[] sources)
+ : base(sources)
{
}
- public NoSnapshotWindows(string[] sourcefolders, Dictionary<string, string> options)
- : base(sourcefolders, options)
+ public NoSnapshotWindows(string[] sources, Dictionary<string, string> options)
+ : base(sources, options)
{
}
diff --git a/Duplicati/Library/Snapshots/WindowsSnapshot.cs b/Duplicati/Library/Snapshots/WindowsSnapshot.cs
index f2d35742d..d37520aae 100644
--- a/Duplicati/Library/Snapshots/WindowsSnapshot.cs
+++ b/Duplicati/Library/Snapshots/WindowsSnapshot.cs
@@ -105,7 +105,7 @@ namespace Duplicati.Library.Snapshots
m_sourcepaths = new string[sourcepaths.Length];
for(int i = 0; i < m_sourcepaths.Length; i++)
- m_sourcepaths[i] = Utility.Utility.AppendDirSeparator(sourcepaths[i]);
+ m_sourcepaths[i] = System.IO.Directory.Exists(sourcepaths[i]) ? Utility.Utility.AppendDirSeparator(sourcepaths[i]) : sourcepaths[i];
try
{