All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Sandbox (push) Successful in 2m45s
Test / ShareFS (push) Successful in 3m36s
Test / Sandbox (race detector) (push) Successful in 5m15s
Test / Hakurei (race detector) (push) Successful in 6m24s
Test / Hakurei (push) Successful in 3m8s
Test / Flake checks (push) Successful in 1m24s
These are no longer needed after migration. Signed-off-by: Ophestra <cat@gensokyo.uk>
39 lines
635 B
Go
39 lines
635 B
Go
package rosa
|
|
|
|
import (
|
|
"path"
|
|
"strings"
|
|
|
|
"hakurei.app/internal/pkg"
|
|
)
|
|
|
|
var (
|
|
_git = H("git")
|
|
_nssCACert = H("nss-cacert")
|
|
)
|
|
|
|
// NewViaGit returns a [pkg.Artifact] for cloning a git repository.
|
|
func (t Toolchain) NewViaGit(
|
|
url, rev string,
|
|
checksum pkg.Checksum,
|
|
) pkg.Artifact {
|
|
return t.New(strings.TrimSuffix(
|
|
path.Base(url),
|
|
".git",
|
|
)+"-src-"+path.Base(rev), THostNet, t.Append(nil,
|
|
_nssCACert,
|
|
_git,
|
|
), &checksum, nil, `
|
|
git \
|
|
-c advice.detachedHead=false \
|
|
clone \
|
|
--depth=1 \
|
|
--revision=`+rev+` \
|
|
--shallow-submodules \
|
|
--recurse-submodules \
|
|
`+url+` \
|
|
/work
|
|
rm -rf /work/.git
|
|
`, resolvconf())
|
|
}
|