Skip to content

Commit 70bd2c2

Browse files
rename default Pkg registry: Uncurated => General (#28066)
1 parent 56a46e3 commit 70bd2c2

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

stdlib/Pkg/bin/generate.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env julia
22
# This file is a part of Julia. License is MIT: https://julialang.org/license
33

4-
prefix = joinpath(homedir(), ".julia", "registries", "Uncurated")
4+
prefix = joinpath(homedir(), ".julia", "registries", "General")
55

66
write_toml(prefix, "Registry") do io
7-
repo = "https://github.com/JuliaRegistries/Uncurated.git"
7+
repo = "https://github.com/JuliaRegistries/General.git"
88
uuid = string(uuid5(uuid_registry, repo))
9-
println(io, "name = ", repr("Uncurated"))
9+
println(io, "name = ", repr("General"))
1010
println(io, "uuid = ", repr(uuid))
1111
println(io, "repo = ", repr(repo))
1212
println(io, "\ndescription = \"\"\"")

stdlib/Pkg/docs/src/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ including:
156156
- `dev`: default directory for package development
157157
- `logs`: log files (e.g. `manifest_usage.toml`, `repl_history.jl`)
158158
- `packages`: installed package versions
159-
- `registries`: clones of registries (e.g. `Uncurated`)
159+
- `registries`: clones of registries (e.g. `General`)
160160

161161
**Load path:** a stack of environments where package identities, their
162162
dependencies, and entry-points are searched for. The load path is controlled in
@@ -209,9 +209,9 @@ In the Pkg REPL packages can be added with the `add` command followed by the nam
209209
```
210210
(v0.7) pkg> add Example
211211
Cloning default registries into /Users/kristoffer/.julia/registries
212-
Cloning registry Uncurated from "https://github.com/JuliaRegistries/Uncurated.git"
213-
Updating registry at `~/.julia/registries/Uncurated`
214-
Updating git-repo `https://github.com/JuliaRegistries/Uncurated.git`
212+
Cloning registry General from "https://github.com/JuliaRegistries/General.git"
213+
Updating registry at `~/.julia/registries/General`
214+
Updating git-repo `https://github.com/JuliaRegistries/General.git`
215215
Resolving package versions...
216216
Updating `~/.julia/environments/v0.7/Project.toml`
217217
[7876af07] + Example v0.5.1
@@ -221,7 +221,7 @@ In the Pkg REPL packages can be added with the `add` command followed by the nam
221221
```
222222

223223
Here we added the package Example to the current project. In this example, we are using a fresh Julia installation,
224-
and this is our first time adding a package using Pkg. By default, Pkg clones Julia's Uncurated registry,
224+
and this is our first time adding a package using Pkg. By default, Pkg clones Julia's General registry,
225225
and uses this registry to look up packages requested for inclusion in the current environment.
226226
The status update shows a short form of the package UUID to the left, then the package name, and the version.
227227
Since standard libraries (e.g. `Test`) are shipped with Julia, they do not have a version. The project status contains the packages
@@ -477,8 +477,8 @@ shell> ls -l
477477
total 0
478478
479479
(MyProject) pkg> add Example
480-
Updating registry at `~/.julia/registries/Uncurated`
481-
Updating git-repo `https://github.com/JuliaRegistries/Uncurated.git`
480+
Updating registry at `~/.julia/registries/General`
481+
Updating git-repo `https://github.com/JuliaRegistries/General.git`
482482
Resolving package versions...
483483
Updating `Project.toml`
484484
[7876af07] + Example v0.5.1

stdlib/Pkg/src/Types.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ function ensure_resolved(env::EnvCache,
798798
cmderror(msg)
799799
end
800800

801-
const DEFAULT_REGISTRIES = Dict("Uncurated" => "https://github.com/JuliaRegistries/Uncurated.git")
801+
const DEFAULT_REGISTRIES = Dict("General" => "https://github.com/JuliaRegistries/General.git")
802802

803803
# Return paths of all registries in a depot
804804
function registries(depot::String)::Vector{String}
@@ -814,8 +814,19 @@ end
814814
function registries(; clone_default=true)::Vector{String}
815815
isempty(depots()) && return String[]
816816
user_regs = abspath(depots()[1], "registries")
817+
# TODO: delete the following let block in Julia 1.0
818+
let uncurated = joinpath(user_regs, "Uncurated"),
819+
general = joinpath(user_regs, "General")
820+
if ispath(uncurated) && !ispath(general)
821+
mv(uncurated, general)
822+
git_config_file = joinpath(general, ".git", "config")
823+
cfg = read(git_config_file, String)
824+
cfg = replace(cfg, r"\bUncurated\b" => "General")
825+
write(git_config_file, cfg)
826+
end
827+
end
817828
if clone_default
818-
if !ispath(user_regs)
829+
if !ispath(user_regs) || isempty(readdir(user_regs))
819830
mkpath(user_regs)
820831
Base.shred!(LibGit2.CachedCredentials()) do creds
821832
printpkgstyle(stdout, :Cloning, "default registries into $user_regs")

0 commit comments

Comments
 (0)