@@ -220,10 +220,14 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
220220 return try await self . assertTool ( " swift " , message: " Please install swift and make sure that it is added to your path. " )
221221 }
222222
223- guard let requiredSwiftVersion = try ? self . findSwiftVersion ( ) else {
223+ guard var requiredSwiftVersion = try ? self . findSwiftVersion ( ) else {
224224 throw Error ( message: " Unable to determine the required swift version for this version of swiftly. Please make sure that you `cd <swiftly_git_dir>` and there is a .swift-version file there. " )
225225 }
226226
227+ if requiredSwiftVersion. hasSuffix ( " .0 " ) {
228+ requiredSwiftVersion = String ( requiredSwiftVersion. dropLast ( 2 ) )
229+ }
230+
227231 let swift = try await self . assertTool ( " swift " , message: " Please install swift \( requiredSwiftVersion) and make sure that it is added to your path. " )
228232
229233 // We also need a swift toolchain with the correct version
@@ -276,8 +280,8 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
276280 try runProgram ( swift, " package " , " reset " )
277281
278282 // Build a specific version of libarchive with a check on the tarball's SHA256
279- let libArchiveVersion = " 3.7.4 "
280- let libArchiveTarSha = " 7875d49596286055b52439ed42f044bd8ad426aa4cc5aabd96bfe7abb971d5e8 "
283+ let libArchiveVersion = " 3.7.9 "
284+ let libArchiveTarSha = " aa90732c5a6bdda52fda2ad468ac98d75be981c15dde263d7b5cf6af66fd009f "
281285
282286 let buildCheckoutsDir = FileManager . default. currentDirectoryPath + " /.build/checkouts "
283287 let libArchivePath = buildCheckoutsDir + " /libarchive- \( libArchiveVersion) "
@@ -287,7 +291,7 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
287291 try ? FileManager . default. createDirectory ( atPath: pkgConfigPath, withIntermediateDirectories: true )
288292
289293 try ? FileManager . default. removeItem ( atPath: libArchivePath)
290- try runProgram ( curl, " -o " , " \( buildCheckoutsDir + " /libarchive- \( libArchiveVersion) .tar.gz " ) " , " --remote-name " , " --location " , " https://github.com/libarchive/libarchive/releases/download/v \( libArchiveVersion) /libarchive- \( libArchiveVersion) .tar.gz " )
294+ try runProgram ( curl, " -L " , " - o" , " \( buildCheckoutsDir + " /libarchive- \( libArchiveVersion) .tar.gz " ) " , " --remote-name " , " --location " , " https://github.com/libarchive/libarchive/releases/download/v \( libArchiveVersion) /libarchive- \( libArchiveVersion) .tar.gz " )
291295 let libArchiveTarShaActual = try await runProgramOutput ( sha256sum, " \( buildCheckoutsDir) /libarchive- \( libArchiveVersion) .tar.gz " )
292296 guard let libArchiveTarShaActual, libArchiveTarShaActual. starts ( with: libArchiveTarSha) else {
293297 let shaActual = libArchiveTarShaActual ?? " none "
@@ -298,7 +302,8 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
298302 let cwd = FileManager . default. currentDirectoryPath
299303 FileManager . default. changeCurrentDirectoryPath ( libArchivePath)
300304
301- let swiftVerRegex : Regex < ( Substring , Substring ) > = try ! Regex ( " Swift version ( \\ d+ \\ . \\ d+ \\ . \\ d+) " )
305+ let swiftVerRegex : Regex < ( Substring , Substring ) > = try ! Regex ( " Swift version ( \\ d+ \\ . \\ d+ \\ .? \\ d*) " )
306+
302307 let swiftVerOutput = ( try await runProgramOutput ( swift, " --version " ) ) ?? " "
303308 guard let swiftVerMatch = try swiftVerRegex. firstMatch ( in: swiftVerOutput) else {
304309 throw Error ( message: " Unable to detect swift version " )
0 commit comments