From 00c2211d45e880e46eeba0ff8af8c0a7ecfae808 Mon Sep 17 00:00:00 2001 From: ta264 Date: Thu, 21 Jan 2021 21:16:33 +0000 Subject: [PATCH] Fixed: Set musl status at compile time [common] --- src/NzbDrone.Common/EnvironmentInfo/OsInfo.cs | 12 +++++------- src/NzbDrone.Common/Prowlarr.Common.csproj | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/NzbDrone.Common/EnvironmentInfo/OsInfo.cs b/src/NzbDrone.Common/EnvironmentInfo/OsInfo.cs index 92b6b0cbc..23b3ab885 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/OsInfo.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/OsInfo.cs @@ -97,16 +97,14 @@ namespace NzbDrone.Common.EnvironmentInfo } else { - return IsMusl() ? Os.LinuxMusl : Os.Linux; +#if ISMUSL + return Os.LinuxMusl; +#else + return Os.Linux; +#endif } } - private static bool IsMusl() - { - var output = RunAndCapture("ldd", "/bin/ls"); - return output.Contains("libc.musl"); - } - private static string RunAndCapture(string filename, string args) { var processStartInfo = new ProcessStartInfo diff --git a/src/NzbDrone.Common/Prowlarr.Common.csproj b/src/NzbDrone.Common/Prowlarr.Common.csproj index e8c3a2e2f..5d5d86354 100644 --- a/src/NzbDrone.Common/Prowlarr.Common.csproj +++ b/src/NzbDrone.Common/Prowlarr.Common.csproj @@ -1,6 +1,7 @@  net5.0;net472 + ISMUSL