Files
hakurei/internal/rosa/git.go
T
cat 95aa7c205c
Test / Create distribution (push) Successful in 53s
Test / Sandbox (push) Successful in 2m54s
Test / Hakurei (push) Successful in 4m32s
Test / Sandbox (race detector) (push) Successful in 5m48s
Test / Hakurei (race detector) (push) Successful in 6m59s
Test / ShareFS (push) Successful in 7m29s
Test / Flake checks (push) Successful in 1m12s
internal/rosa: remove calls to low-level exec helper
This method predates the helper infrastructure, it is awkward to use and difficult to maintain for the replacement bootstrap mechanism. This change prepares for its removal.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2026-07-27 18:24:38 +09:00

46 lines
734 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.NewPackage(strings.TrimSuffix(
path.Base(url),
".git",
)+"-src", path.Base(rev), nil, &PackageAttr{
KnownChecksum: &checksum,
Flag: THostNet,
Paths: []pkg.ExecPath{resolvconf()},
}, &GenericHelper{
Build: `
git \
-c advice.detachedHead=false \
clone \
--depth=1 \
--revision=` + rev + ` \
--shallow-submodules \
--recurse-submodules \
` + url + ` \
/work
rm -rf /work/.git
`,
},
_nssCACert,
_git,
)
}