@@ -934,14 +934,14 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
934
934
entry = entry:: Dict{String, Any}
935
935
uuid = get (entry, " uuid" , nothing ):: Union{String, Nothing}
936
936
uuid === nothing && continue
937
+ # deps is either a list of names (deps = ["DepA", "DepB"]) or
938
+ # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
939
+ deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
937
940
if UUID (uuid) === where . uuid
938
941
found_where = true
939
- # deps is either a list of names (deps = ["DepA", "DepB"]) or
940
- # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
941
- deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
942
942
if deps isa Vector{String}
943
943
found_name = name in deps
944
- break
944
+ found_name && @goto done
945
945
elseif deps isa Dict{String, Any}
946
946
deps = deps:: Dict{String, Any}
947
947
for (dep, uuid) in deps
@@ -960,30 +960,33 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
960
960
return PkgId (UUID (uuid), name)
961
961
end
962
962
exts = extensions[where . name]:: Union{String, Vector{String}}
963
+ weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
963
964
if (exts isa String && name == exts) || (exts isa Vector{String} && name in exts)
964
- weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
965
- if weakdeps != = nothing
966
- if weakdeps isa Vector{String}
967
- found_name = name in weakdeps
968
- break
969
- elseif weakdeps isa Dict{String, Any}
970
- weakdeps = weakdeps:: Dict{String, Any}
971
- for (dep, uuid) in weakdeps
972
- uuid:: String
973
- if dep === name
974
- return PkgId (UUID (uuid), name)
965
+ for deps′ in [weakdeps, deps]
966
+ if deps′ != = nothing
967
+ if deps′ isa Vector{String}
968
+ found_name = name in deps′
969
+ found_name && @goto done
970
+ elseif deps′ isa Dict{String, Any}
971
+ deps′ = deps′:: Dict{String, Any}
972
+ for (dep, uuid) in deps′
973
+ uuid:: String
974
+ if dep === name
975
+ return PkgId (UUID (uuid), name)
976
+ end
977
+ end
975
978
end
976
979
end
977
980
end
978
981
end
979
- end
980
982
# `name` is not an ext, do standard lookup as if this was the parent
981
983
return identify_package (PkgId (UUID (uuid), dep_name), name)
982
984
end
983
985
end
984
986
end
985
987
end
986
988
end
989
+ @label done
987
990
found_where || return nothing
988
991
found_name || return PkgId (name)
989
992
# Only reach here if deps was not a dict which mean we have a unique name for the dep
0 commit comments