@@ -22,7 +22,7 @@ using SHA
2222
2323export UUID, SHA1, VersionRange, VersionSpec,
2424 PackageSpec, PackageEntry, EnvCache, Context, GitRepo, Context!, Manifest, Project, err_rep,
25- PkgError, pkgerror, has_name, has_uuid, is_stdlib, stdlib_version, is_unregistered_stdlib, stdlibs, write_env, write_env_usage, parse_toml, find_registered!,
25+ PkgError, pkgerror, has_name, has_uuid, is_stdlib, is_unregistered_stdlib, stdlibs, write_env, write_env_usage, parse_toml, find_registered!,
2626 project_resolve!, project_deps_resolve!, manifest_resolve!, registry_resolve!, stdlib_resolve!, handle_repos_develop!, handle_repos_add!, ensure_resolved,
2727 registered_name,
2828 manifest_info,
@@ -405,9 +405,8 @@ is_stdlib(uuid::UUID) = uuid in keys(stdlibs())
405405
406406# Find the entry in `STDLIBS_BY_VERSION`
407407# that corresponds to the requested version, and use that.
408- # If we can't find one, defaults to `UNREGISTERED_STDLIBS`
409408function get_last_stdlibs (julia_version:: VersionNumber )
410- last_stdlibs = UNREGISTERED_STDLIBS
409+ last_stdlibs = Dict {UUID,String} ()
411410 for (version, stdlibs) in STDLIBS_BY_VERSION
412411 if VersionNumber (julia_version. major, julia_version. minor, julia_version. patch) < version
413412 break
@@ -416,10 +415,6 @@ function get_last_stdlibs(julia_version::VersionNumber)
416415 end
417416 return last_stdlibs
418417end
419- # If `julia_version` is set to `nothing`, that means (essentially) treat all registered
420- # stdlibs as normal packages so that we get the latest versions of everything, ignoring
421- # julia compat. So we set the list of stdlibs to that of only the unregistered stdlibs.
422- get_last_stdlibs (:: Nothing ) = UNREGISTERED_STDLIBS
423418
424419# Allow asking if something is an stdlib for a particular version of Julia
425420function is_stdlib (uuid:: UUID , julia_version:: Union{VersionNumber, Nothing} )
@@ -428,24 +423,23 @@ function is_stdlib(uuid::UUID, julia_version::Union{VersionNumber, Nothing})
428423 return is_stdlib (uuid)
429424 end
430425
426+ # If this UUID is known to be unregistered, always return `true`
427+ if haskey (UNREGISTERED_STDLIBS, uuid)
428+ return true
429+ end
430+
431+ # Otherwise, if the `julia_version` is `nothing`, all registered stdlibs
432+ # will be treated like normal packages.
433+ if julia_version === nothing
434+ return false
435+ end
436+
431437 last_stdlibs = get_last_stdlibs (julia_version)
432438 # Note that if the user asks for something like `julia_version = 0.7.0`, we'll
433439 # fall through with an empty `last_stdlibs`, which will always return `false`.
434440 return uuid in keys (last_stdlibs)
435441end
436442
437- # Return the version of a stdlib with respect to a particular Julia version, or
438- # `nothing` if that stdlib is not versioned. We only store version numbers for
439- # stdlibs that are external and thus could be installed from their repositories,
440- # e.g. things like `GMP_jll`, `Tar`, etc...
441- function stdlib_version (uuid:: UUID , julia_version:: Union{VersionNumber,Nothing} )
442- last_stdlibs = get_last_stdlibs (julia_version)
443- if ! (uuid in keys (last_stdlibs))
444- return nothing
445- end
446- return last_stdlibs[uuid][2 ]
447- end
448-
449443is_unregistered_stdlib (uuid:: UUID ) = haskey (UNREGISTERED_STDLIBS, uuid)
450444
451445Context! (kw_context:: Vector{Pair{Symbol,Any}} ):: Context =
0 commit comments