forked from rosa/hakurei
internal/rosa: key metadata by string
For upcoming azalea integration. The API is quite ugly right now to ease migration. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -7,12 +7,12 @@ import (
|
||||
"hakurei.app/internal/pkg"
|
||||
)
|
||||
|
||||
func (t Toolchain) newGit() (pkg.Artifact, string) {
|
||||
func (t Toolchain) newGit(s *S) (pkg.Artifact, string) {
|
||||
const (
|
||||
version = "2.54.0"
|
||||
checksum = "7vGKtFOJGqY8DO4e8UMRax7dLgImXKQz5MMalec6MlgYrsarffSJjgOughwRFpSH"
|
||||
)
|
||||
return t.NewPackage("git", version, newTar(
|
||||
return s.NewPackage(t, "git", version, newTar(
|
||||
"https://www.kernel.org/pub/software/scm/git/"+
|
||||
"git-"+version+".tar.gz",
|
||||
checksum,
|
||||
@@ -88,7 +88,7 @@ disable_test t5515-fetch-merge-logic
|
||||
), version
|
||||
}
|
||||
func init() {
|
||||
artifactsM[Git] = Metadata{
|
||||
native.MustRegister(&Artifact{
|
||||
f: Toolchain.newGit,
|
||||
|
||||
Name: "git",
|
||||
@@ -102,18 +102,19 @@ func init() {
|
||||
},
|
||||
|
||||
ID: 5350,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// NewViaGit returns a [pkg.Artifact] for cloning a git repository.
|
||||
func (t Toolchain) NewViaGit(
|
||||
func (s *S) NewViaGit(
|
||||
t Toolchain,
|
||||
url, rev string,
|
||||
checksum pkg.Checksum,
|
||||
) pkg.Artifact {
|
||||
return t.New(strings.TrimSuffix(
|
||||
return s.New(t, strings.TrimSuffix(
|
||||
path.Base(url),
|
||||
".git",
|
||||
)+"-src-"+path.Base(rev), THostNet, t.AppendPresets(nil,
|
||||
)+"-src-"+path.Base(rev), THostNet, s.AppendPresets(t, nil,
|
||||
NSSCACert,
|
||||
Git,
|
||||
), &checksum, nil, `
|
||||
@@ -131,6 +132,6 @@ rm -rf /work/.git
|
||||
}
|
||||
|
||||
// newTagRemote is a helper around NewViaGit for a tag on a git remote.
|
||||
func (t Toolchain) newTagRemote(url, tag, checksum string) pkg.Artifact {
|
||||
return t.NewViaGit(url, "refs/tags/"+tag, mustDecode(checksum))
|
||||
func (s *S) newTagRemote(t Toolchain, url, tag, checksum string) pkg.Artifact {
|
||||
return s.NewViaGit(t, url, "refs/tags/"+tag, mustDecode(checksum))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user