@@ -974,14 +974,14 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
974
974
entry = entry:: Dict{String, Any}
975
975
uuid = get (entry, " uuid" , nothing ):: Union{String, Nothing}
976
976
uuid === nothing && continue
977
+ # deps is either a list of names (deps = ["DepA", "DepB"]) or
978
+ # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
979
+ deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
977
980
if UUID (uuid) === where . uuid
978
981
found_where = true
979
- # deps is either a list of names (deps = ["DepA", "DepB"]) or
980
- # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
981
- deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
982
982
if deps isa Vector{String}
983
983
found_name = name in deps
984
- break
984
+ found_name && @goto done
985
985
elseif deps isa Dict{String, Any}
986
986
deps = deps:: Dict{String, Any}
987
987
for (dep, uuid) in deps
@@ -1000,30 +1000,33 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
1000
1000
return PkgId (UUID (uuid), name)
1001
1001
end
1002
1002
exts = extensions[where . name]:: Union{String, Vector{String}}
1003
+ weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
1003
1004
if (exts isa String && name == exts) || (exts isa Vector{String} && name in exts)
1004
- weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
1005
- if weakdeps != = nothing
1006
- if weakdeps isa Vector{String}
1007
- found_name = name in weakdeps
1008
- break
1009
- elseif weakdeps isa Dict{String, Any}
1010
- weakdeps = weakdeps:: Dict{String, Any}
1011
- for (dep, uuid) in weakdeps
1012
- uuid:: String
1013
- if dep === name
1014
- return PkgId (UUID (uuid), name)
1005
+ for deps′ in [weakdeps, deps]
1006
+ if deps′ != = nothing
1007
+ if deps′ isa Vector{String}
1008
+ found_name = name in deps′
1009
+ found_name && @goto done
1010
+ elseif deps′ isa Dict{String, Any}
1011
+ deps′ = deps′:: Dict{String, Any}
1012
+ for (dep, uuid) in deps′
1013
+ uuid:: String
1014
+ if dep === name
1015
+ return PkgId (UUID (uuid), name)
1016
+ end
1017
+ end
1015
1018
end
1016
1019
end
1017
1020
end
1018
1021
end
1019
- end
1020
1022
# `name` is not an ext, do standard lookup as if this was the parent
1021
1023
return identify_package (PkgId (UUID (uuid), dep_name), name)
1022
1024
end
1023
1025
end
1024
1026
end
1025
1027
end
1026
1028
end
1029
+ @label done
1027
1030
found_where || return nothing
1028
1031
found_name || return PkgId (name)
1029
1032
# Only reach here if deps was not a dict which mean we have a unique name for the dep
0 commit comments