From b8c9a3f3002b63bbb0bcc52737bd98c92ee78a38 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 29 May 2018 13:11:01 +0200 Subject: [PATCH] make find_stdlib_deps more resiliant when weird things are inside the package folder --- stdlib/Pkg/src/Operations.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stdlib/Pkg/src/Operations.jl b/stdlib/Pkg/src/Operations.jl index 0b7e203f934f7d..efc37b149536ce 100644 --- a/stdlib/Pkg/src/Operations.jl +++ b/stdlib/Pkg/src/Operations.jl @@ -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