@@ -17,28 +17,28 @@ public static ArtifactInfo FromPath(StorageNode sha256Node, SemanticVersion prov
1717 throw new FormatException ( $ "{ fileNode . Name } failed to detected as { nameof ( ArtifactInfo ) } .") ;
1818 }
1919
20- KnownOS os = ParseKnownOSChar ( match . Groups [ "os " ] . Value ) ;
20+ KnownOS os = ParseKnownOSChar ( match . Groups [ "dist " ] . Value ) ;
2121
2222 return new ArtifactInfo ( os , match . Groups [ "dist" ] . Value , match . Groups [ "arch" ] . Value , providedVersion , sha256Node . LastModified , match . Groups [ "ext" ] . Value ,
2323 fileNode . FullPath , sha256Node . FullPath ) ;
2424 }
2525
26- private static KnownOS ParseKnownOSChar ( string osChar )
26+ private static KnownOS ParseKnownOSChar ( string dist )
2727 {
28- return osChar switch
28+ return dist switch
2929 {
30- "l " => KnownOS . Linux ,
31- "m " => KnownOS . MacOS ,
32- "w " => KnownOS . Windows ,
33- _ => throw new FormatException ( $ "Failed to parse { osChar } as { nameof ( KnownOS ) } .")
30+ "debian10" or "rhel8" or "ubuntu22" or "centos7" or "ubuntu20" or "ubuntu24 " => KnownOS . Linux ,
31+ "macos_12_6 " => KnownOS . MacOS ,
32+ "windows " => KnownOS . Windows ,
33+ _ => throw new FormatException ( $ "Failed to parse { dist } as { nameof ( KnownOS ) } .")
3434 } ;
3535 }
3636
3737 internal static bool NameIdentifier ( string name ) => name . EndsWith ( HashSuffix ) ;
3838 internal static string ArtifactFileExtractor ( string name ) => name [ ..( ^ HashSuffix . Length ) ] ;
3939 private const string HashSuffix = ".sha256" ;
4040
41- [ GeneratedRegex ( @"^(?<os>[m|w|l])_openvino_toolkit_ (?<dist>\w+)_(?<version>\d{4}\.\d\.\d\.[\w\.]+)_(?<arch>armhf|x86_64|arm64)\.(?<ext>\w+)$" ) ]
41+ [ GeneratedRegex ( @"^openvino_toolkit_ (?<dist>\w+)_(?<version>\d{4}\.\d\.\d\.[\w\.]+)_(?<arch>armhf|x86_64|arm64)\.(?<ext>\w+)$" ) ]
4242 private static partial Regex OpenVINOArtifactNameRegex ( ) ;
4343
4444 internal static IEnumerable < ArtifactInfo > FromFolder ( VersionFolder vf )
0 commit comments