Microsoft.NETCore.Platforms: support adding rids with '-' in the base part. (#84413)
authorTom Deseyn <tom.deseyn@gmail.com>
Thu, 6 Apr 2023 18:50:50 +0000 (20:50 +0200)
committerGitHub <noreply@github.com>
Thu, 6 Apr 2023 18:50:50 +0000 (11:50 -0700)
commit238e3d36f60c62e55eae25fe441ae73430fe975d
tree7d885d048dff91a38134b010b91c5b320d09760a
parent8e26f2bf37779e6b68c206e1a0a9e07c4da7c366
Microsoft.NETCore.Platforms: support adding rids with '-' in the base part. (#84413)

* Microsoft.NETCore.Platforms: support adding rids with '-' in the base part.

Currently when trying to add a rid like 'linux-musl-x64'
the rid is not understood to be base = 'linux-musl', arch = 'x64'.

Instead the parser considers a potential optional qualifier.
This causes the rid to be parsed as base = 'linux', arch = 'musl',
and qualifier = 'x64'.

We know the rids being added won't have a qualifier. If we take
this into account while parsing, we can parse the rid correctly.

* Update src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
---------

Co-authored-by: Eric StJohn <ericstj@microsoft.com>
src/libraries/Microsoft.NETCore.Platforms/src/RID.cs
src/libraries/Microsoft.NETCore.Platforms/src/RuntimeGroupCollection.cs
src/libraries/Microsoft.NETCore.Platforms/tests/RidTests.cs