@@ -878,14 +878,14 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
878
878
entry = entry:: Dict{String, Any}
879
879
uuid = get (entry, " uuid" , nothing ):: Union{String, Nothing}
880
880
uuid === nothing && continue
881
+ # deps is either a list of names (deps = ["DepA", "DepB"]) or
882
+ # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
883
+ deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
881
884
if UUID (uuid) === where . uuid
882
885
found_where = true
883
- # deps is either a list of names (deps = ["DepA", "DepB"]) or
884
- # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
885
- deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
886
886
if deps isa Vector{String}
887
887
found_name = name in deps
888
- break
888
+ found_name && @goto done
889
889
elseif deps isa Dict{String, Any}
890
890
deps = deps:: Dict{String, Any}
891
891
for (dep, uuid) in deps
@@ -904,30 +904,33 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
904
904
return PkgId (UUID (uuid), name)
905
905
end
906
906
exts = extensions[where . name]:: Union{String, Vector{String}}
907
+ weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
907
908
if (exts isa String && name == exts) || (exts isa Vector{String} && name in exts)
908
- weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
909
- if weakdeps != = nothing
910
- if weakdeps isa Vector{String}
911
- found_name = name in weakdeps
912
- break
913
- elseif weakdeps isa Dict{String, Any}
914
- weakdeps = weakdeps:: Dict{String, Any}
915
- for (dep, uuid) in weakdeps
916
- uuid:: String
917
- if dep === name
918
- return PkgId (UUID (uuid), name)
909
+ for deps′ in [weakdeps, deps]
910
+ if deps′ != = nothing
911
+ if deps′ isa Vector{String}
912
+ found_name = name in deps′
913
+ found_name && @goto done
914
+ elseif deps′ isa Dict{String, Any}
915
+ deps′ = deps′:: Dict{String, Any}
916
+ for (dep, uuid) in deps′
917
+ uuid:: String
918
+ if dep === name
919
+ return PkgId (UUID (uuid), name)
920
+ end
921
+ end
919
922
end
920
923
end
921
924
end
922
925
end
923
- end
924
926
# `name` is not an ext, do standard lookup as if this was the parent
925
927
return identify_package (PkgId (UUID (uuid), dep_name), name)
926
928
end
927
929
end
928
930
end
929
931
end
930
932
end
933
+ @label done
931
934
found_where || return nothing
932
935
found_name || return PkgId (name)
933
936
# Only reach here if deps was not a dict which mean we have a unique name for the dep
0 commit comments