Skip to content

Commit a7b0c54

Browse files
committed
update Pkg3 precompile statements
1 parent e9df7b6 commit a7b0c54

File tree

5 files changed

+183
-549
lines changed

5 files changed

+183
-549
lines changed

stdlib/Pkg3/src/API.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function update_registry(ctx)
7070
for reg in registries()
7171
if isdir(joinpath(reg, ".git"))
7272
regpath = pathrepr(ctx, reg)
73-
printpkgstyle(ctx, :Updating, "registry at ", regpath)
73+
printpkgstyle(ctx, :Updating, "registry at " * regpath)
7474
LibGit2.with(LibGit2.GitRepo, reg) do repo
7575
if LibGit2.isdirty(repo)
7676
push!(errors, (regpath, "registry dirty"))

stdlib/Pkg3/src/Display.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ function status(ctx::Context, mode::PackageMode, use_as_api=false)
5252
m₁ = filter_manifest(in_project(project₁["deps"]), manifest₁)
5353
diff = manifest_diff(ctx, m₀, m₁)
5454
if !use_as_api
55-
printpkgstyle(ctx, :Status, pathrepr(ctx, env.project_file); ignore_indent=true)
56-
print_diff(ctx, diff; status = true)
55+
printpkgstyle(ctx, :Status, pathrepr(ctx, env.project_file), #=ignore_indent=# true)
56+
print_diff(ctx, diff, #=status=# true)
5757
end
5858
end
5959
if mode == PKGMODE_MANIFEST
6060
diff = manifest_diff(ctx, manifest₀, manifest₁)
6161
if !use_as_api
62-
printpkgstyle(ctx, :Status, pathrepr(ctx, env.manifest_file); ignore_indent=true)
63-
print_diff(ctx, diff; status = true)
62+
printpkgstyle(ctx, :Status, pathrepr(ctx, env.manifest_file), #=ignore_indent=# true)
63+
print_diff(ctx, diff, #=status=# true)
6464
end
6565
elseif mode == PKGMODE_COMBINED
6666
p = not_in_project(merge(project₀["deps"], project₁["deps"]))
@@ -69,8 +69,8 @@ function status(ctx::Context, mode::PackageMode, use_as_api=false)
6969
c_diff = filter!(x->x.old != x.new, manifest_diff(ctx, m₀, m₁))
7070
if !isempty(c_diff)
7171
if !use_as_api
72-
printpkgstyle(ctx, :Status, pathrepr(ctx, env.manifest_file); ignore_indent=true)
73-
print_diff(ctx, c_diff; status = true)
72+
printpkgstyle(ctx, :Status, pathrepr(ctx, env.manifest_file), #=ignore_indent=# true)
73+
print_diff(ctx, c_diff, #=status=# true)
7474
end
7575
diff = Base.vcat(c_diff, diff)
7676
end
@@ -132,7 +132,7 @@ struct DiffEntry
132132
new::Union{VerInfo,Nothing}
133133
end
134134

135-
function print_diff(io::IO, ctx::Context, diff::Vector{DiffEntry}; status=false)
135+
function print_diff(io::IO, ctx::Context, diff::Vector{DiffEntry}, status=false)
136136
same = all(x.old == x.new for x in diff)
137137
some_packages_not_downloaded = false
138138
for x in diff
@@ -181,7 +181,7 @@ function print_diff(io::IO, ctx::Context, diff::Vector{DiffEntry}; status=false)
181181
end
182182
end
183183
# TODO: Use the Context stream
184-
print_diff(ctx::Context, diff::Vector{DiffEntry}; kwargs...) = print_diff(stdout, ctx, diff; kwargs...)
184+
print_diff(ctx::Context, diff::Vector{DiffEntry}, status=true) = print_diff(stdout, ctx, diff, status)
185185

186186
function manifest_by_uuid(manifest::Dict)
187187
entries = Dict{UUID,Dict}()

stdlib/Pkg3/src/Operations.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ function build_versions(ctx::Context, uuids::Vector{UUID}; might_need_to_resolve
842842
for (uuid, name, hash_or_path, build_file) in builds
843843
log_file = splitext(build_file)[1] * ".log"
844844
printpkgstyle(ctx, :Building,
845-
rpad(name * " ", max_name + 1, ""), "", Types.pathrepr(ctx, log_file))
845+
rpad(name * " ", max_name + 1, "") * "", Types.pathrepr(ctx, log_file))
846846
code = """
847847
empty!(Base.DEPOT_PATH)
848848
append!(Base.DEPOT_PATH, $(repr(map(abspath, DEPOT_PATH))))
@@ -1121,7 +1121,7 @@ function init(ctx::Context)
11211121
cmderror("Project already initialized at $project_file")
11221122
mkpath(dirname(project_file))
11231123
touch(project_file)
1124-
printpkgstyle(ctx, :Initialized, "project at ", abspath(project_file))
1124+
printpkgstyle(ctx, :Initialized, "project at " * abspath(project_file))
11251125
end
11261126

11271127
end # module

stdlib/Pkg3/src/Types.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ function read_manifest(io::IO)
621621
return manifest
622622
end
623623
function read_manifest(file::String)
624-
try isfile(file) ? open(read_manifest, file) : read_manifest(devnull)
624+
try isfile(file) ? open(read_manifest, file) : read_manifest(devnull)
625625
catch err
626626
err isa ErrorException && startswith(err.msg, "ambiguious dependency") || rethrow(err)
627627
err.msg *= "In manifest file: $file"
@@ -1219,16 +1219,16 @@ function manifest_info(env::EnvCache, uuid::UUID)::Union{Dict{String,Any},Nothin
12191219
end
12201220

12211221
# TODO: redirect to ctx stream
1222-
function printpkgstyle(io::IO, cmd::Symbol, text::String...; ignore_indent=false)
1222+
function printpkgstyle(io::IO, cmd::Symbol, text::String, ignore_indent=false)
12231223
indent = textwidth(string(:Downloaded))
12241224
ignore_indent && (indent = 0)
12251225
printstyled(io, lpad(string(cmd), indent), color=:green, bold=true)
1226-
println(io, " ", text...)
1226+
println(io, " ", text)
12271227
end
12281228

12291229
# TODO: use ctx specific context
1230-
function printpkgstyle(ctx::Context, cmd::Symbol, text::String...; kwargs...)
1231-
printpkgstyle(stdout, cmd, text...; kwargs...)
1230+
function printpkgstyle(ctx::Context, cmd::Symbol, text::String, ignore_indent=false)
1231+
printpkgstyle(stdout, cmd, text)
12321232
end
12331233

12341234

0 commit comments

Comments
 (0)