Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug for Julia 1.6: reachable_registries not defined #71

Closed
tfiers opened this issue Jan 11, 2023 · 3 comments
Closed

bug for Julia 1.6: reachable_registries not defined #71

tfiers opened this issue Jan 11, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@tfiers
Copy link
Owner

tfiers commented Jan 11, 2023

From

PkgDep's reachable_registries() (https://github.com/JuliaEcosystem/PkgDeps.jl/blob/a568954/src/PkgDeps.jl#L71) is not necessary. merged in base mayb.
mayb is necessary for 1.6

@tfiers tfiers added the bug Something isn't working label Jan 11, 2023
@tfiers
Copy link
Owner Author

tfiers commented Jan 11, 2023

So sth like

joinpath(Base.DEPOT_PAT, "registries", 
reachable_registries() = [RegistryInstance(joinpath(reg_dir, name)))]
.. hm
julia> DEPOT_PATH
3-element Vector{String}:
 "C:\\Users\\tfiers\\.julia"
 "C:\\Julia-1.8.1\\local\\share\\julia"
 "C:\\Julia-1.8.1\\share\\julia"

julia> @edit Pkg.Registry.reachable_registries()

gives

src
function reachable_registries(; depots::Union{String, Vector{String}}=Base.DEPOT_PATH)
    # collect registries
    if depots isa String
        depots = [depots]
    end
    registries = RegistryInstance[]
    for d in depots
        isdir(d) || continue
        reg_dir = joinpath(d, "registries")
        isdir(reg_dir) || continue
        reg_paths = readdir(reg_dir; join=true)
        candidate_registries = String[]
        # All folders could be registries
        append!(candidate_registries, filter(isdir, reg_paths))
        if registry_read_from_tarball()
            compressed_registries = filter(endswith(".toml"), reg_paths)
            # if we are reading compressed registries, ignore compressed registries
            # with the same name
            compressed_registry_names = Set([splitext(basename(file))[1] for file in compressed_registries])
            filter!(x -> !(basename(x) in compressed_registry_names), candidate_registries)
            for compressed_registry in compressed_registries
                if verify_compressed_registry_toml(compressed_registry)
                    push!(candidate_registries, compressed_registry)
                end
            end
        end

        for candidate in candidate_registries
            # candidate can be either a folder or a TOML file
            if isfile(joinpath(candidate, "Registry.toml")) || isfile(candidate)
                push!(registries, RegistryInstance(candidate))
            end
        end
    end
    return registries
end

@tfiers
Copy link
Owner Author

tfiers commented Jan 11, 2023

eh if you see ?DEPOT_PATHS,
we may do:

user_depot = first(DEPOT_PATHS)
RegistryInstance(joinpath(user_depot, "registries", "General.toml"))

@tfiers
Copy link
Owner Author

tfiers commented Jan 11, 2023

(it also didn't have RegistryInstance. and more, probably. seems like total rewrite. so yeah, no, byeeh!)

btw, I think you can analyse old pkg versions -- incl "julia 1.6 pkgs" -- while in a newer julia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant