Skip to content

Commit b009e50

Browse files
committed
fix contain/ismatch
1 parent 15891b1 commit b009e50

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/PackageCompiler.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ const julia_v07 = VERSION > v"0.7-"
77
if julia_v07
88
using Libdl
99
import Sys: iswindows, isunix, isapple
10+
const contains07 = contains
1011
else
1112
const iswindows = is_windows
1213
const isunix = is_unix
1314
const isapple = is_apple
15+
contains07(str, reg) = ismatch(reg, str)
1416
end
1517

1618
using SnoopCompile

src/static_julia.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,12 @@ function sync_julia_files(verbose)
242242
if iswindows() || isapple()
243243
append!(libfiles, joinpath.(dir, filter(x -> endswith(x, dlext), readdir(dir))))
244244
else
245-
append!(libfiles, joinpath.(dir, filter(x -> contains(x, r"^lib.+\.so(?:\.\d+)*$"), readdir(dir))))
245+
append!(libfiles, joinpath.(dir, filter(x -> contains07(x, r"^lib.+\.so(?:\.\d+)*$"), readdir(dir))))
246246
end
247247
end
248248
sync = false
249249
for src in libfiles
250-
if julia_v07
251-
contains(src, r"debug") && continue
252-
else
253-
ismatch(r"debug", src) && continue
254-
end
250+
contains07(src, r"debug") && continue
255251
dst = basename(src)
256252
if filesize(src) != filesize(dst) || ctime(src) > ctime(dst) || mtime(src) > mtime(dst)
257253
verbose && println(" $dst")

0 commit comments

Comments
 (0)