Skip to content

Commit f394b70

Browse files
committed
move Pkg to stdlib
1 parent a0fe64c commit f394b70

37 files changed

+120
-102
lines changed

base/docs/Docs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ function summarize(io::IO, T::DataType, binding)
416416
end
417417

418418
function summarize(io::IO, m::Module, binding)
419-
readme = Pkg.dir(string(m), "README.md")
419+
readme = Base.PKG_MODULE_REF[].dir(string(m), "README.md")
420420
if isfile(readme)
421421
println(io, "Displaying the `README.md` for the module instead.\n")
422422
println(io, "---\n")

base/exports.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
export
44
# Modules
55
Meta,
6-
Pkg,
76
LibGit2,
87
StackTraces,
98
Sys,

base/initdefs.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ function init_load_path(BINDIR = Sys.BINDIR)
129129
load_path = get(ENV, "JULIA_LOAD_PATH", "@|@v#.#.#|@v#.#|@v#|@default|@!v#.#")
130130
append!(empty!(LOAD_PATH), parse_load_path(load_path))
131131
vers = "v$(VERSION.major).$(VERSION.minor)"
132-
push!(LOAD_PATH, Pkg.dir)
133132
push!(LOAD_PATH, abspath(BINDIR, "..", "local", "share", "julia", "site", vers))
134133
push!(LOAD_PATH, abspath(BINDIR, "..", "share", "julia", "site", vers))
135134
end

base/interactiveutil.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,11 @@ function versioninfo(io::IO=STDOUT; verbose::Bool=false, packages::Bool=false)
340340
end
341341
if packages || verbose
342342
println(io, "Packages:")
343-
println(io, " Package Directory: ", Pkg.dir())
343+
println(io, " Package Directory: ", PKG_MODULE_REF[].dir())
344344
print(io, " Package Status:")
345-
if isdir(Pkg.dir())
345+
if isdir(PKG_MODULE_REF[].dir())
346346
println(io, "")
347-
Pkg.status(io)
347+
PKG_MODULE_REF[].status(io)
348348
else
349349
println(io, " no packages installed")
350350
end

base/markdown/Markdown.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export readme, license, @md_str, @doc_str
2929
parse(markdown::AbstractString; flavor = julia) = parse(IOBuffer(markdown), flavor = flavor)
3030
parse_file(file::AbstractString; flavor = julia) = parse(read(file, String), flavor = flavor)
3131

32-
readme(pkg::AbstractString; flavor = github) = parse_file(Pkg.dir(pkg, "README.md"), flavor = flavor)
32+
readme(pkg::AbstractString; flavor = github) = parse_file(Base.PKG_MODULE_REF[].dir(pkg, "README.md"), flavor = flavor)
3333
readme(pkg::Module; flavor = github) = readme(string(pkg), flavor = flavor)
3434

35-
license(pkg::AbstractString; flavor = github) = parse_file(Pkg.dir(pkg, "LICENSE.md"), flavor = flavor)
35+
license(pkg::AbstractString; flavor = github) = parse_file(Base.PKG_MODULE_REF[].dir(pkg, "LICENSE.md"), flavor = flavor)
3636
license(pkg::Module; flavor = github) = license(string(pkg), flavor = flavor)
3737

3838
function mdexpr(s, flavor = :julia)

base/precompile.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ precompile(Tuple{typeof(Base.show_method_params), Base.GenericIOBuffer{Array{UIn
383383
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, String, Module})
384384
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, String, Symbol, String, Int32})
385385
precompile(Tuple{typeof(Base.reverseind), String, Int64})
386-
precompile(Tuple{typeof(Base.Pkg.Dir.path)})
387386
precompile(Tuple{typeof(Base.promote_type), Type{String}, Type{Union{}}})
388387
precompile(Tuple{typeof(Base.promote_type), Type{Any}, Type{String}})
389388
precompile(Tuple{typeof(Base.promote_rule), Type{Any}, Type{String}})
@@ -620,7 +619,6 @@ precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, Stri
620619
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, DataType, Char})
621620
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, typeof(Type), Char})
622621
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, String, Module, String, Char})
623-
precompile(Tuple{typeof(Base.Pkg.dir), String, String})
624622
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Array{Base.Docs.DocStr, 1}, Symbol, Int64})
625623
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.Docs.Binding, Symbol, Int64})
626624
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Type{Union{}}, Symbol, Int64})

base/reflection.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Get the fully-qualified name of a module as a tuple of symbols. For example,
4848
4949
# Examples
5050
```jldoctest
51-
julia> fullname(Base.Pkg)
52-
(:Base, :Pkg)
51+
julia> fullname(Base.Iterators)
52+
(:Base, :Iterators)
5353
5454
julia> fullname(Main)
5555
(:Main,)

base/sysimg.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ include("missing.jl")
441441
# libgit2 support
442442
include("libgit2/libgit2.jl")
443443

444-
# package manager
445-
include("pkg/pkg.jl")
444+
const PKG_MODULE_REF = Ref{Module}()
446445

447446
# worker threads
448447
include("threadcall.jl")
@@ -525,6 +524,7 @@ Base.require(Base, :SuiteSparse)
525524
Base.require(Base, :Test)
526525
Base.require(Base, :Unicode)
527526
Base.require(Base, :REPL)
527+
Base.require(Base, :Pkg)
528528

529529
@eval Base begin
530530
@deprecate_binding Test root_module(Base, :Test) true ", run `using Test` instead"
@@ -559,6 +559,8 @@ Base.require(Base, :REPL)
559559
@deprecate_binding LineEdit root_module(Base, :REPL).LineEdit true ", use `REPL.LineEdit` instead"
560560
@deprecate_binding REPLCompletions root_module(Base, :REPL).REPLCompletions true ", use `REPL.REPLCompletions` instead"
561561
@deprecate_binding Terminals root_module(Base, :REPL).Terminals true ", use `REPL.Terminals` instead"
562+
563+
@deprecate_binding Pkg root_module(Base, :Pkg) true ", run `using Pkg` instead"
562564
end
563565

564566
empty!(DEPOT_PATH)

doc/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Install dependencies needed to build the documentation.
22
ENV["JULIA_PKGDIR"] = joinpath(@__DIR__, "deps")
3+
using Pkg
34
Pkg.init()
45
cp(joinpath(@__DIR__, "REQUIRE"), Pkg.dir("REQUIRE"); remove_destination = true)
56
Pkg.update()
@@ -101,7 +102,6 @@ const PAGES = [
101102
"base/io-network.md",
102103
"base/punctuation.md",
103104
"base/sort.md",
104-
"base/pkg.md",
105105
"base/iterators.md",
106106
"base/c.md",
107107
"base/libc.md",

doc/src/base/base.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ Base.LibGit2
9191
Base.Libc
9292
Base.Markdown
9393
Base.Meta
94-
Base.Pkg
9594
Base.StackTraces
9695
Base.Sys
9796
Base.Threads

0 commit comments

Comments
 (0)