Fixed: Set musl status at compile time

pull/770/head
ta264 4 years ago committed by Qstick
parent 64e2f6457d
commit d7cdbbecc8

@ -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();

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>net462;netcoreapp3.1</TargetFrameworks>
<NeutralLanguage>en</NeutralLanguage>
<DefineConstants Condition="'$(RuntimeIdentifier)' == 'linux-musl-x64' or '$(RuntimeIdentifier)' == 'linux-musl-arm64'">ISMUSL</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNet4.SocksProxy" Version="1.4.0.1" />

Loading…
Cancel
Save