@@ -7,15 +7,15 @@ var swiftGPGKeysRefreshed = false
77/// This implementation can be reused for any supported Linux platform.
88/// TODO: replace dummy implementations
99public struct Linux: Platform {
10- let linuxPlatforms = [
11- PlatformDefinition . ubuntu2404,
12- PlatformDefinition . ubuntu2204,
13- PlatformDefinition . ubuntu2004,
14- PlatformDefinition . ubuntu1804,
15- PlatformDefinition . fedora39,
16- PlatformDefinition . rhel9,
17- PlatformDefinition . amazonlinux2,
18- PlatformDefinition . debian12,
10+ let linuxPlatforms : [ PlatformDefinition ] = [
11+ . ubuntu2404,
12+ . ubuntu2204,
13+ . ubuntu2004,
14+ . ubuntu1804,
15+ . fedora39,
16+ . rhel9,
17+ . amazonlinux2,
18+ . debian12,
1919 ]
2020
2121 public init ( ) { }
@@ -382,13 +382,7 @@ public struct Linux: Platform {
382382 }
383383
384384 public func getExecutableName( ) -> String {
385- #if arch(x86_64)
386- let arch = " x86_64 "
387- #elseif arch(arm64)
388- let arch = " aarch64 "
389- #else
390- fatalError ( " Unsupported processor architecture " )
391- #endif
385+ let arch = cpuArch
392386
393387 return " swiftly- \( arch) -unknown-linux-gnu "
394388 }
@@ -516,7 +510,7 @@ public struct Linux: Platform {
516510 return await self . manualSelectPlatform ( platformPretty)
517511 }
518512
519- return PlatformDefinition . amazonlinux2
513+ return . amazonlinux2
520514 } else if ( id + ( idlike ?? " " ) ) . contains ( " rhel " ) {
521515 guard versionID. hasPrefix ( " 9 " ) else {
522516 let message = " Unsupported version of RHEL "
@@ -528,7 +522,7 @@ public struct Linux: Platform {
528522 return await self . manualSelectPlatform ( platformPretty)
529523 }
530524
531- return PlatformDefinition . rhel9
525+ return . rhel9
532526 } else if let pd = [ PlatformDefinition . ubuntu1804, . ubuntu2004, . ubuntu2204, . ubuntu2404, . debian12, . fedora39] . first ( where: { $0. name == id + versionID } ) {
533527 return pd
534528 }
0 commit comments