forked from security/hakurei
internal/rosa/git: git clone helper
For obtaining sources of projects that stubbornly refuse to provide release tarballs. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -76,3 +76,26 @@ make \
|
||||
)
|
||||
}
|
||||
func init() { artifactsF[Git] = Toolchain.newGit }
|
||||
|
||||
// NewViaGit returns a [pkg.Artifact] for cloning a git repository.
|
||||
func (t Toolchain) NewViaGit(
|
||||
name, url, rev string,
|
||||
checksum pkg.Checksum,
|
||||
) pkg.Artifact {
|
||||
return t.New(name+"-"+rev, 0, []pkg.Artifact{
|
||||
t.Load(NSSCACert),
|
||||
t.Load(OpenSSL),
|
||||
t.Load(Libpsl),
|
||||
t.Load(Curl),
|
||||
t.Load(Libexpat),
|
||||
t.Load(Git),
|
||||
}, &checksum, nil, `
|
||||
git \
|
||||
-c advice.detachedHead=false \
|
||||
clone \
|
||||
--revision=`+rev+` \
|
||||
`+url+` \
|
||||
/work
|
||||
rm -rf /work/.git
|
||||
`, resolvconf())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user