Skip to content

Commit d9522e4

Browse files
committed
Use isbindingresolved when checking imported packages
1 parent 73b8dcb commit d9522e4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

base/pkg/entry.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ function resolve(
541541
info("$(up)grading $pkg: v$ver1 => v$ver2")
542542
Write.update(pkg, Read.sha1(pkg,ver2))
543543
pkgsym = Symbol(pkg)
544-
if isdefined(Main, pkgsym) && isa(getfield(Main, pkgsym), Module)
544+
if Base.isbindingresolved(Main, pkgsym) && isa(getfield(Main, pkgsym), Module)
545545
push!(imported, "- $pkg")
546546
end
547547
end

test/pkg.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,16 @@ temp_pkg_dir() do
489489
@test isempty(Pkg.dependents("Example"))
490490
@test isempty(Pkg.dependents("Example.jl"))
491491

492+
@test_warn s -> !contains(s, "updated but were already imported") begin
493+
Pkg.add("Iterators")
494+
Pkg.update("Iterators")
495+
end
496+
497+
# Do it again, because the above Iterators test will update things prematurely
498+
LibGit2.with(LibGit2.GitRepo, metadata_dir) do repo
499+
LibGit2.reset!(repo, LibGit2.GitHash(old_commit), LibGit2.Consts.RESET_HARD)
500+
end
501+
492502
@test_warn ("INFO: Installing Colors v0.6.4",
493503
"INFO: Installing ColorTypes v0.2.2",
494504
"INFO: Installing FixedPointNumbers v0.1.3",

0 commit comments

Comments
 (0)