From d3fcffb84542ec213ca0834a12aa962e9dc4e5af Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Thu, 10 Mar 2016 21:51:45 +0100 Subject: [PATCH 1/4] Bugfix for an error message --- Duplicati/Library/Main/BackendManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duplicati/Library/Main/BackendManager.cs b/Duplicati/Library/Main/BackendManager.cs index ff78a126a..6010b10ff 100644 --- a/Duplicati/Library/Main/BackendManager.cs +++ b/Duplicati/Library/Main/BackendManager.cs @@ -413,7 +413,7 @@ namespace Duplicati.Library.Main { m_encryption = DynamicLoader.EncryptionLoader.GetModule(m_options.EncryptionModule, m_options.Passphrase, m_options.RawOptions); if (m_encryption == null) - throw new Exception(string.Format("Encryption method not supported: ", m_options.EncryptionModule)); + throw new Exception(string.Format("Encryption method not supported: {0}", m_options.EncryptionModule)); } if (m_taskControl != null) From 18fbcbf2a057b6b64871f77f8a66b8c591e4beab Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Thu, 10 Mar 2016 21:51:55 +0100 Subject: [PATCH 2/4] Fixed some wrong comments --- Duplicati/Library/Main/Options.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Duplicati/Library/Main/Options.cs b/Duplicati/Library/Main/Options.cs index ba652ef17..66fbe435b 100644 --- a/Duplicati/Library/Main/Options.cs +++ b/Duplicati/Library/Main/Options.cs @@ -690,12 +690,12 @@ namespace Duplicati.Library.Main /// - /// Gets a value indicating whether a temporary folder has been specified + /// Gets a value indicating whether the user has forced the locale /// public bool HasForcedLocale { get { return m_options.ContainsKey("force-locale"); } } /// - /// Gets the folder where temporary files are stored + /// Gets the forced locale for the current user /// public System.Globalization.CultureInfo ForcedLocale { From 3a5c3f44d88bcb9ea17aa565715a8a0af4dfd465 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Thu, 10 Mar 2016 21:53:00 +0100 Subject: [PATCH 3/4] Fixed an issue where some data was not correctly reported after an error was detected --- Duplicati/Library/Main/Operation/FilelistProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Duplicati/Library/Main/Operation/FilelistProcessor.cs b/Duplicati/Library/Main/Operation/FilelistProcessor.cs index 28d599879..d0ff235b8 100644 --- a/Duplicati/Library/Main/Operation/FilelistProcessor.cs +++ b/Duplicati/Library/Main/Operation/FilelistProcessor.cs @@ -112,7 +112,7 @@ namespace Duplicati.Library.Main.Operation if (doubles.Count > 0) { - var s = string.Format("Found remote files reported as duplicates, either the backend module is broken or you need to manually remove the extra copies.\nThe following files were found multiple times: ", string.Join(", ", doubles.Keys)); + var s = string.Format("Found remote files reported as duplicates, either the backend module is broken or you need to manually remove the extra copies.\nThe following files were found multiple times: {0}", string.Join(", ", doubles.Keys)); log.AddError(s, null); throw new Exception(s); } From f86b66a8887679322c0f14baabb9747846bc8367 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Thu, 10 Mar 2016 21:53:28 +0100 Subject: [PATCH 4/4] Fixed issue #1606 --- Duplicati/Library/Main/Controller.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Duplicati/Library/Main/Controller.cs b/Duplicati/Library/Main/Controller.cs index ee21fdc72..a112fc2a9 100644 --- a/Duplicati/Library/Main/Controller.cs +++ b/Duplicati/Library/Main/Controller.cs @@ -380,6 +380,16 @@ namespace Duplicati.Library.Main m_currentTaskThread = null; } } + + /// + /// Attempts to set the locale, but delays linking to the calls as they are missing in some environments + /// + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] + private static void DoSetLocale(System.Globalization.CultureInfo locale, System.Globalization.CultureInfo uiLocale) + { + System.Globalization.CultureInfo.DefaultThreadCurrentCulture = locale; + System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = uiLocale; + } private void OnOperationComplete(object result) { @@ -407,10 +417,12 @@ namespace Duplicati.Library.Main if (m_doResetLocale) { - System.Globalization.CultureInfo.DefaultThreadCurrentCulture = m_resetLocale; - System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = m_resetLocaleUI; + // Wrap the call to avoid loading issues for the setLocale method + DoSetLocale(m_resetLocale, m_resetLocaleUI); + m_doResetLocale = false; m_resetLocale = null; + m_resetLocaleUI = null; } if (m_resetKeys != null) @@ -524,8 +536,9 @@ namespace Duplicati.Library.Main m_resetLocale = System.Globalization.CultureInfo.DefaultThreadCurrentCulture; m_resetLocaleUI = System.Globalization.CultureInfo.DefaultThreadCurrentUICulture; m_doResetLocale = true; - System.Globalization.CultureInfo.DefaultThreadCurrentCulture = locale; - System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = locale; + + // Wrap the call to avoid loading issues for the setLocale method + DoSetLocale(locale, locale); } if (!string.IsNullOrEmpty(m_options.ThreadPriority))