Skip to content

Commit

Permalink
Index the rootfs download cache by artifact hash, not by filename. (#261
Browse files Browse the repository at this point in the history
)
  • Loading branch information
maleadt authored Feb 13, 2024
1 parent 80a1895 commit 6082593
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rootfs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ function _create_rootfs(config::Configuration)
# download
url = rootfs_toml["download"][1]["url"]
hash = rootfs_toml["download"][1]["sha256"]
tarball = joinpath(download_dir, "rootfs", basename(url))
tarball = joinpath(download_dir, hash)
if !isfile(tarball)
Pkg.PlatformEngines.download_verify(url, hash, tarball)
end

# extract
open(tarball) do io
stream = if endswith(tarball, ".xz")
stream = if endswith(url, ".xz")
XzDecompressorStream(io)
elseif endswith(tarball, ".gz")
elseif endswith(url, ".gz")
GzipDecompressorStream(io)
elseif endswith(tarball, ".zst")
elseif endswith(url, ".zst")
ZstdDecompressorStream(io)
else
error("Unknown file extension")
Expand Down

0 comments on commit 6082593

Please sign in to comment.