Skip to content

Commit

Permalink
rm LibGit2 dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
topolarity committed Sep 12, 2024
1 parent 680d6f2 commit 1f1d784
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 364 deletions.
1 change: 0 additions & 1 deletion stdlib/ArtifactDownloads/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
FileWatching = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
p7zip_jll = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
Expand Down
12 changes: 6 additions & 6 deletions stdlib/ArtifactDownloads/src/ArtifactDownloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ArtifactDownloads

include("Utils.jl")
include("MiniProgressBars.jl")
include("GitTools.jl")
include("GitTreeHashTools.jl")
include("PlatformEngines.jl")

import TOML
Expand All @@ -11,8 +11,8 @@ import SHA: sha256

import ..Utils: set_readonly, pkg_server, can_fancyprint, stderr_f, printpkgstyle,
write_env_usage, can_symlink, parse_toml
import ..GitTools
import ..PlatformEngines: package, download_verify_unpack
import ..GitTreeHashTools: git_tree_hash

import Base.BinaryPlatforms: AbstractPlatform, HostPlatform, triplet
import Artifacts: artifact_names, ARTIFACTS_DIR_OVERRIDE, ARTIFACT_OVERRIDES, artifact_path,
Expand Down Expand Up @@ -45,7 +45,7 @@ function create_artifact(f::Function)
f(temp_dir)

# Calculate the tree hash for this temporary directory
artifact_hash = SHA1(GitTools.tree_hash(temp_dir))
artifact_hash = SHA1(git_tree_hash(temp_dir))

# If we created a dupe, just let the temp directory get destroyed. It's got the
# same contents as whatever already exists after all, so it doesn't matter. Only
Expand Down Expand Up @@ -135,7 +135,7 @@ function verify_artifact(hash::SHA1; honor_overrides::Bool=false)
end

# Otherwise actually run the verification
return all(hash.bytes .== GitTools.tree_hash(artifact_path(hash)))
return all(hash.bytes .== git_tree_hash(artifact_path(hash)))
end

"""
Expand Down Expand Up @@ -179,7 +179,7 @@ Writes a mapping of `name` -> `hash` within the given `(Julia)Artifacts.toml` fi
`platform` is not `nothing`, this artifact is marked as platform-specific, and will be
a multi-mapping. It is valid to bind multiple artifacts with the same name, but
different `platform`s and `hash`'es within the same `artifacts_toml`. If `force` is set
to `true`, this will overwrite a pre-existant mapping, otherwise an error is raised.
to `true`, this will overwrite a pre-existent mapping, otherwise an error is raised.
`download_info` is an optional vector that contains tuples of URLs and a hash. These
URLs will be listed as possible locations where this artifact can be obtained. If `lazy`
Expand Down Expand Up @@ -334,7 +334,7 @@ function download_artifact(
try
download_verify_unpack(tarball_url, tarball_hash, temp_dir, ignore_existence=true, verbose=verbose,
quiet_download=quiet_download, io=io)
calc_hash = SHA1(GitTools.tree_hash(temp_dir))
calc_hash = SHA1(git_tree_hash(temp_dir))

# Did we get what we expected? If not, freak out.
if calc_hash.bytes != tree_hash.bytes
Expand Down
Loading

0 comments on commit 1f1d784

Please sign in to comment.