Update PlatformApis to handle Gentoo Linux.
authorBjarke Istrup Pedersen <gurli@gurlinet.dk>
Fri, 12 May 2017 19:26:23 +0000 (19:26 +0000)
committerBjarke Istrup Pedersen <gurli@gurlinet.dk>
Fri, 12 May 2017 19:26:23 +0000 (19:26 +0000)
Commit migrated from https://github.com/dotnet/core-setup/commit/0eed46462cc9b3354d440eae5c933a55b1572d3f

src/installer/managed/Microsoft.DotNet.PlatformAbstractions/Native/PlatformApis.cs

index f982012..3a2c7cd 100644 (file)
@@ -128,6 +128,13 @@ namespace Microsoft.DotNet.PlatformAbstractions.Native
         // are backwards compatible.
         private static DistroInfo NormalizeDistroInfo(DistroInfo distroInfo)
         {
+            if (distroInfo.Id == "gentoo")
+            {
+                // Gentoo does not have versions, since they use rolling releases.
+                // Workaround this by setting VersionId to the current year and month.
+                distroInfo.VersionId = DateTime.Today.ToString("yyyy.MM");
+            }
+
             int minorVersionNumberSeparatorIndex = distroInfo.VersionId.IndexOf('.');
 
             if (distroInfo.Id == "rhel" && minorVersionNumberSeparatorIndex != -1)