Skip to content

Commit 50c37de

Browse files
committed
Use raw string
1 parent ddcace0 commit 50c37de

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/AutoBuild.jl

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,8 +1416,8 @@ function build_jll_package(src_name::String,
14161416
!ispath(pkg_dir) && mkdir(pkg_dir)
14171417
write(joinpath(pkg_dir, "platform_augmentation.jl"), augment_platform_block)
14181418

1419-
overload_parse = """
1420-
# Update Base.parse for Julia <1.12 to support riscv64
1419+
overload_parse = raw"""
1420+
# Update Base.parse to support riscv64, needed for Julia <1.12
14211421
@static if !haskey(BinaryPlatforms.arch_mapping, "riscv64")
14221422
14231423
function bbparse(::Type{Platform}, triplet::AbstractString; validate_strict::Bool = false)
@@ -1433,7 +1433,7 @@ function build_jll_package(src_name::String,
14331433
14341434
# Helper function to collapse dictionary of mappings down into a regex of
14351435
# named capture groups joined by "|" operators
1436-
c(mapping) = string("(",join(["(?<\$k>\$v)" for (k, v) in mapping], "|"), ")")
1436+
c(mapping) = string("(",join(["(?<$k>$v)" for (k, v) in mapping], "|"), ")")
14371437
14381438
# We're going to build a mondo regex here to parse everything:
14391439
triplet_regex = Regex(string(
@@ -1448,8 +1448,8 @@ function build_jll_package(src_name::String,
14481448
c(cxxstring_abi_mapping),
14491449
c(libstdcxx_version_mapping),
14501450
# Finally, the catch-all for extended tags
1451-
"(?<tags>(?:-[^-]+\\\\+[^-]+)*)?",
1452-
"\\\$",
1451+
"(?<tags>(?:-[^-]+\\+[^-]+)*)?",
1452+
"\$",
14531453
))
14541454
14551455
m = match(triplet_regex, triplet)
@@ -1502,10 +1502,13 @@ function build_jll_package(src_name::String,
15021502
end
15031503
os_version = nothing
15041504
if os == "macos"
1505-
os_version = extract_os_version("macos", r".*darwin([\\d\\.]+)")
1505+
os_version = extract_os_version("macos", r".*darwin([\d.]+)"sa)
15061506
end
15071507
if os == "freebsd"
1508-
os_version = extract_os_version("freebsd", r".*freebsd([\\d.]+)")
1508+
os_version = extract_os_version("freebsd", r".*freebsd([\d.]+)"sa)
1509+
end
1510+
if os == "openbsd"
1511+
os_version = extract_os_version("openbsd", r".*openbsd([\d.]+)"sa)
15091512
end
15101513
15111514
return Platform(

0 commit comments

Comments
 (0)