Skip to content

Commit 1284d6f

Browse files
committed
When using a custom depot, still look in bundled directories.
1 parent 13d3efb commit 1284d6f

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

base/initdefs.jl

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ See also [`JULIA_DEPOT_PATH`](@ref JULIA_DEPOT_PATH), and
8686
"""
8787
const DEPOT_PATH = String[]
8888

89-
function append_default_depot_path!(DEPOT_PATH)
90-
path = joinpath(homedir(), ".julia")
91-
path in DEPOT_PATH || push!(DEPOT_PATH, path)
89+
function append_bundled_depot_path!(DEPOT_PATH)
9290
path = abspath(Sys.BINDIR, "..", "local", "share", "julia")
9391
path in DEPOT_PATH || push!(DEPOT_PATH, path)
9492
path = abspath(Sys.BINDIR, "..", "share", "julia")
@@ -98,21 +96,26 @@ end
9896

9997
function init_depot_path()
10098
empty!(DEPOT_PATH)
99+
populated = false
100+
101101
if haskey(ENV, "JULIA_DEPOT_PATH")
102102
str = ENV["JULIA_DEPOT_PATH"]
103-
isempty(str) && return
104103
for path in eachsplit(str, Sys.iswindows() ? ';' : ':')
105-
if isempty(path)
106-
append_default_depot_path!(DEPOT_PATH)
107-
else
108-
path = expanduser(path)
109-
path in DEPOT_PATH || push!(DEPOT_PATH, path)
110-
end
104+
isempty(path) && continue
105+
path = expanduser(path)
106+
path in DEPOT_PATH || push!(DEPOT_PATH, path)
107+
populated = true
111108
end
112-
else
113-
append_default_depot_path!(DEPOT_PATH)
114109
end
115-
nothing
110+
111+
if !populated
112+
path = joinpath(homedir(), ".julia")
113+
push!(DEPOT_PATH, path)
114+
end
115+
116+
append_bundled_depot_path!(DEPOT_PATH)
117+
118+
return
116119
end
117120

118121
## LOAD_PATH & ACTIVE_PROJECT ##

test/loading.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ end
721721
@testset "expansion of JULIA_DEPOT_PATH" begin
722722
s = Sys.iswindows() ? ';' : ':'
723723
tmp = "/this/does/not/exist"
724-
DEFAULT = Base.append_default_depot_path!(String[])
724+
DEFAULT = Base.append_bundled_depot_path!(String[])
725725
cases = Dict{Any,Vector{String}}(
726726
nothing => DEFAULT,
727727
"" => [],

0 commit comments

Comments
 (0)