Skip to content

Commit

Permalink
get rid of this
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Mar 18, 2021
1 parent 8d556a4 commit 4ffea6a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Registry/Registry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ function download_registries(io::IO, regs::Vector{RegistrySpec}, depot::String=d
else
mktempdir() do tmp
if reg.path !== nothing && reg.linked == true # symlink to local source
registry = Registry.RegistryInstance(reg.path; parse_packages=false)
registry = Registry.RegistryInstance(reg.path)
regpath = joinpath(depot, "registries", registry.name)
printpkgstyle(io, :Symlinking, "registry from `$(Base.contractuser(reg.path))`")
isdir(dirname(regpath)) || mkpath(dirname(regpath))
symlink(reg.path, regpath)
isfile(joinpath(regpath, "Registry.toml")) || Pkg.Types.pkgerror("no `Registry.toml` file in linked registry.")
registry = Registry.RegistryInstance(regpath; parse_packages=false)
registry = Registry.RegistryInstance(regpath)
printpkgstyle(io, :Symlinked, "registry `$(Base.contractuser(registry.name))` to `$(Base.contractuser(regpath))`")
return
elseif url !== nothing && registry_use_pkg_server()
Expand All @@ -214,7 +214,7 @@ function download_registries(io::IO, regs::Vector{RegistrySpec}, depot::String=d
elseif reg.path !== nothing # copy from local source
printpkgstyle(io, :Copying, "registry from `$(Base.contractuser(reg.path))`")
isfile(joinpath(reg.path, "Registry.toml")) || Pkg.Types.pkgerror("no `Registry.toml` file in source directory.")
registry = Registry.RegistryInstance(reg.path; parse_packages=false)
registry = Registry.RegistryInstance(reg.path)
regpath = joinpath(depot, "registries", registry.name)
cp(reg.path, regpath; force=true) # has to be cp given we're copying
printpkgstyle(io, :Copied, "registry `$(Base.contractuser(registry.name))` to `$(Base.contractuser(regpath))`")
Expand All @@ -229,12 +229,12 @@ function download_registries(io::IO, regs::Vector{RegistrySpec}, depot::String=d
if !isfile(joinpath(tmp, "Registry.toml"))
Pkg.Types.pkgerror("no `Registry.toml` file in cloned registry.")
end
registry = Registry.RegistryInstance(tmp; parse_packages=false)
registry = Registry.RegistryInstance(tmp)
regpath = joinpath(depot, "registries", registry.name)
# copy to `depot`
ispath(dirname(regpath)) || mkpath(dirname(regpath))
if isfile(joinpath(regpath, "Registry.toml"))
existing_registry = Registry.RegistryInstance(regpath; parse_packages=false)
existing_registry = Registry.RegistryInstance(regpath)
if registry.uuid == existing_registry.uuid
println(io,
"registry `$(registry.name)` already exist in `$(Base.contractuser(regpath))`.")
Expand All @@ -243,7 +243,7 @@ function download_registries(io::IO, regs::Vector{RegistrySpec}, depot::String=d
mv(tmp, regpath, force=true)
printpkgstyle(io, :Added, "registry `$(registry.name)` to `$(Base.contractuser(regpath))`")
end
elseif registry_use_pkg_server(url) || reg.linked !== true
elseif url !== nothing && registry_use_pkg_server() || reg.linked !== true
# if the dir doesn't exist, or exists but doesn't contain a Registry.toml
mv(tmp, regpath, force=true)
printpkgstyle(io, :Added, "registry `$(registry.name)` to `$(Base.contractuser(regpath))`")
Expand Down

0 comments on commit 4ffea6a

Please sign in to comment.