Reading versions of a package from unpacked registry tarball

greg_plowman
Mon, 21 Feb 2022 05:00:16 +0000
General Usage

With the old-style git clone registry, I could find the latest version of a package by reading the Versions.toml file in the unpacked registry directory structure:

function latest_version(pkgname::AbstractString)
    path = joinpath(DEPOT_PATH[1], "registries", "General", first(pkgname,1), pkgname, "Versions.toml")
    return maximum(VersionNumber.(keys(Pkg.TOML.parse(read(path, String)))))
end

How would I extract the latest version of a package from a tarball registry?
Is there an existing function for this? Do I need to unpack the registry first or can I read the tarball directly?

3 posts - 2 participants