From 3fcd8af697e6570ba79851dfe58c071982d3ab30 Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 27 Jan 2021 21:35:20 +0000 Subject: [PATCH] Fixed: Set musl status at compile time --- src/NzbDrone.Common/EnvironmentInfo/OsInfo.cs | 12 +++++------- src/NzbDrone.Common/Lidarr.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 09035be21..aba718098 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) { Process p = new Process(); diff --git a/src/NzbDrone.Common/Lidarr.Common.csproj b/src/NzbDrone.Common/Lidarr.Common.csproj index dd0e47767..4fe8a0b27 100644 --- a/src/NzbDrone.Common/Lidarr.Common.csproj +++ b/src/NzbDrone.Common/Lidarr.Common.csproj @@ -2,6 +2,7 @@ net462;netcoreapp3.1 en + ISMUSL