From 2c47c5eb99486cf13d1c3e8c72fa930391c93ee3 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Sat, 24 Aug 2019 01:23:04 +0200 Subject: [PATCH] Fixed: Missing debian package dependency and made them optional. --- build.sh | 25 ++++++++++++++++--- distribution/debian/control | 2 +- .../Instrumentation/NzbDroneLogger.cs | 19 +++++++++++--- .../EnvironmentInfo/DotNetPlatformInfo.cs | 16 ++++++++++++ version.sh | 2 +- 5 files changed, 55 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 95fa27c44..58a48a86c 100755 --- a/build.sh +++ b/build.sh @@ -197,9 +197,28 @@ PackageMono() echo "Adding CurlSharp.dll.config (for dllmap)" cp $sourceFolder/NzbDrone.Common/CurlSharp.dll.config $outputFolderLinux - # Is blacklisted by mono from loading from appdir, instead loading from mono GAC. - echo "Remove System.Runtime.InteropServices.RuntimeInformation.dll (uses win32 interop)" - rm $outputFolderLinux/System.Runtime.InteropServices.RuntimeInformation.dll + # Below we deal with some mono incompatibilities with windows-only dotnet core/standard libs + # See: https://github.com/mono/mono/blob/master/tools/nuget-hash-extractor/download.sh + # That list defines assemblies that are prohibited from being loaded from the appdir, instead loading from mono GAC. + + # We have debian dependencies to get these installed + for assembly in System.IO.Compression System.Runtime.InteropServices.RuntimeInformation System.Net.Http + do + if [ -e $outputFolderLinux/$assembly.dll ] ; then + echo "Remove $assembly.dll (uses win32 interop)" + rm $outputFolderLinux/$assembly.dll + fi + done + + # These assemblies have facades in mono-devel, but we don't have them. + for assembly in System.Globalization.Extensions System.Text.Encoding.CodePages System.Threading.Overlapped + do + if [ -e $outputFolderLinux/$assembly.dll ] ; then + echo "Warn: Facade $assembly.dll (uses win32 interop)" + rm $outputFolderLinux/$assembly.dll + #exit 1 + fi + done echo "Renaming Sonarr.Console.exe to Sonarr.exe" rm $outputFolderLinux/Sonarr.exe* diff --git a/distribution/debian/control b/distribution/debian/control index 8623e9265..71ab7cc76 100644 --- a/distribution/debian/control +++ b/distribution/debian/control @@ -16,7 +16,7 @@ Architecture: all Provides: nzbdrone Conflicts: nzbdrone Replaces: nzbdrone -Depends: adduser, libsqlite3-0 (>= 3.7), libmediainfo0v5 (>= 0.7.52) | libmediainfo0 (>= 0.7.52), mono-runtime (>= 5.4), ${cli:Depends}, ${misc:Depends} +Depends: adduser, libsqlite3-0 (>= 3.7), libmediainfo0v5 (>= 0.7.52) | libmediainfo0 (>= 0.7.52), mono-runtime (>= 5.4), libmono-system-runtime-interopservices-runtimeinformation4.0-cil, libmono-system-net-http4.0-cil, ${cli:Depends}, ${misc:Depends} Recommends: libmediainfo0v5 (>= 18.03) | libmediainfo0 (>= 18.03), libcurl4 | libcurl3 Suggests: sqlite3 (>= 3.7), mediainfo (>= 0.7.52) Description: Internet PVR diff --git a/src/NzbDrone.Common/Instrumentation/NzbDroneLogger.cs b/src/NzbDrone.Common/Instrumentation/NzbDroneLogger.cs index fa6087762..bcb01df9b 100644 --- a/src/NzbDrone.Common/Instrumentation/NzbDroneLogger.cs +++ b/src/NzbDrone.Common/Instrumentation/NzbDroneLogger.cs @@ -103,11 +103,22 @@ namespace NzbDrone.Common.Instrumentation : "https://4ee3580e01d8407c96a7430fbc953512:5f2d07227a0b4fde99dea07041a3ff93@sentry.sonarr.tv/10"; } - var target = new SentryTarget(dsn) + Target target; + try { - Name = "sentryTarget", - Layout = "${message}" - }; + target = new SentryTarget(dsn) + { + Name = "sentryTarget", + Layout = "${message}" + }; + } + catch (Exception ex) + { + LogManager.GetLogger(nameof(NzbDroneLogger)).Debug(ex, "Failed to load dependency, may need an OS update"); + + // We still need the logging rules, so use a null target. + target = new NullTarget(); + } var loggingRule = new LoggingRule("*", updateClient ? LogLevel.Trace : LogLevel.Warn, target); LogManager.Configuration.AddTarget("sentryTarget", target); diff --git a/src/NzbDrone.Windows/EnvironmentInfo/DotNetPlatformInfo.cs b/src/NzbDrone.Windows/EnvironmentInfo/DotNetPlatformInfo.cs index 015b1270c..561acb3ac 100644 --- a/src/NzbDrone.Windows/EnvironmentInfo/DotNetPlatformInfo.cs +++ b/src/NzbDrone.Windows/EnvironmentInfo/DotNetPlatformInfo.cs @@ -33,6 +33,22 @@ namespace NzbDrone.Windows.EnvironmentInfo var releaseKey = (int)ndpKey.GetValue("Release"); + if (releaseKey >= 528040) + { + return new Version(4, 8, 0); + } + if (releaseKey >= 461808) + { + return new Version(4, 7, 2); + } + if (releaseKey >= 461308) + { + return new Version(4, 7, 1); + } + if (releaseKey >= 460798) + { + return new Version(4, 7); + } if (releaseKey >= 394802) { return new Version(4, 6, 2); diff --git a/version.sh b/version.sh index 9427be711..d1c1fb591 100644 --- a/version.sh +++ b/version.sh @@ -1,7 +1,7 @@ #! /bin/bash # Increment packageVersion when package scripts change -packageVersion='3.0.2' +packageVersion='3.0.3' # For now we keep the build version and package version the same buildVersion=$packageVersion