Skip to content

Commit

Permalink
Use isbindingresolved when checking imported packages (#21580)
Browse files Browse the repository at this point in the history
(cherry picked from commit d762038)
  • Loading branch information
ararslan authored and tkelman committed Jun 2, 2017
1 parent 2ec983d commit 2b4d7fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/pkg/entry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ function resolve(
info("$(up)grading $pkg: v$ver1 => v$ver2")
Write.update(pkg, Read.sha1(pkg,ver2))
pkgsym = Symbol(pkg)
if isdefined(Main, pkgsym) && isa(getfield(Main, pkgsym), Module)
if Base.isbindingresolved(Main, pkgsym) && isa(getfield(Main, pkgsym), Module)
push!(imported, "- $pkg")
end
end
Expand Down
10 changes: 10 additions & 0 deletions test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,16 @@ temp_pkg_dir() do
@test isempty(Pkg.dependents("Example"))
@test isempty(Pkg.dependents("Example.jl"))

@test_warn s -> !contains(s, "updated but were already imported") begin
Pkg.add("Iterators")
Pkg.update("Iterators")
end

# Do it again, because the above Iterators test will update things prematurely
LibGit2.with(LibGit2.GitRepo, metadata_dir) do repo
LibGit2.reset!(repo, LibGit2.GitHash(old_commit), LibGit2.Consts.RESET_HARD)
end

@test_warn ("INFO: Installing Colors v0.6.4",
"INFO: Installing ColorTypes v0.2.2",
"INFO: Installing FixedPointNumbers v0.1.3",
Expand Down

0 comments on commit 2b4d7fe

Please sign in to comment.