Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use isbindingresolved when checking imported packages #21580

Merged
merged 1 commit into from
May 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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