@@ -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,
@@ -411,9 +411,8 @@ is_stdlib(uuid::UUID) = uuid in keys(stdlibs())
411411
412412# Find the entry in `STDLIBS_BY_VERSION`
413413# that corresponds to the requested version, and use that.
414- # If we can't find one, defaults to `UNREGISTERED_STDLIBS`
415414function get_last_stdlibs (julia_version:: VersionNumber )
416- last_stdlibs = UNREGISTERED_STDLIBS
415+ last_stdlibs = Dict {UUID,String} ()
417416 for (version, stdlibs) in STDLIBS_BY_VERSION
418417 if VersionNumber (julia_version. major, julia_version. minor, julia_version. patch) < version
419418 break
@@ -422,10 +421,6 @@ function get_last_stdlibs(julia_version::VersionNumber)
422421 end
423422 return last_stdlibs
424423end
425- # If `julia_version` is set to `nothing`, that means (essentially) treat all registered
426- # stdlibs as normal packages so that we get the latest versions of everything, ignoring
427- # julia compat. So we set the list of stdlibs to that of only the unregistered stdlibs.
428- get_last_stdlibs (:: Nothing ) = UNREGISTERED_STDLIBS
429424
430425# Allow asking if something is an stdlib for a particular version of Julia
431426function is_stdlib (uuid:: UUID , julia_version:: Union{VersionNumber, Nothing} )
@@ -434,24 +429,23 @@ function is_stdlib(uuid::UUID, julia_version::Union{VersionNumber, Nothing})
434429 return is_stdlib (uuid)
435430 end
436431
432+ # If this UUID is known to be unregistered, always return `true`
433+ if haskey (UNREGISTERED_STDLIBS, uuid)
434+ return true
435+ end
436+
437+ # Otherwise, if the `julia_version` is `nothing`, all registered stdlibs
438+ # will be treated like normal packages.
439+ if julia_version === nothing
440+ return false
441+ end
442+
437443 last_stdlibs = get_last_stdlibs (julia_version)
438444 # Note that if the user asks for something like `julia_version = 0.7.0`, we'll
439445 # fall through with an empty `last_stdlibs`, which will always return `false`.
440446 return uuid in keys (last_stdlibs)
441447end
442448
443- # Return the version of a stdlib with respect to a particular Julia version, or
444- # `nothing` if that stdlib is not versioned. We only store version numbers for
445- # stdlibs that are external and thus could be installed from their repositories,
446- # e.g. things like `GMP_jll`, `Tar`, etc...
447- function stdlib_version (uuid:: UUID , julia_version:: Union{VersionNumber,Nothing} )
448- last_stdlibs = get_last_stdlibs (julia_version)
449- if ! (uuid in keys (last_stdlibs))
450- return nothing
451- end
452- return last_stdlibs[uuid][2 ]
453- end
454-
455449is_unregistered_stdlib (uuid:: UUID ) = haskey (UNREGISTERED_STDLIBS, uuid)
456450
457451Context! (kw_context:: Vector{Pair{Symbol,Any}} ):: Context =
0 commit comments