Skip to content

Commit

Permalink
make find_stdlib_deps more resiliant when weird things are inside the…
Browse files Browse the repository at this point in the history
… package folder
  • Loading branch information
KristofferC committed May 29, 2018
1 parent 7f1a8bf commit b8c9a3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions stdlib/Pkg/src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,14 @@ end
function find_stdlib_deps(ctx::Context, path::String)
stdlib_deps = Dict{UUID, String}()
regexps = [Regex("\\b(import|using)\\s+((\\w|\\.)+\\s*,\\s*)*$lib\\b") for lib in values(ctx.stdlibs)]
for (root, dirs, files) in walkdir(path)
for (root, dirs, files) in walkdir(path; onerror = x->nothing)
for file in files
endswith(file, ".jl") || continue
filecontent = read(joinpath(root, file), String)
filecontent = try read(joinpath(root, file), String)
catch e
e isa SystemError || rethrow(e)
""
end
for ((uuid, stdlib), r) in zip(ctx.stdlibs, regexps)
if occursin(r, filecontent)
stdlib_deps[uuid] = stdlib
Expand Down

0 comments on commit b8c9a3f

Please sign in to comment.