aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs
diff options
context:
space:
mode:
authorLaura Peskin <pesk@google.com>2024-07-03 14:15:53 -0700
committereepeep <50846949+eepeep@users.noreply.github.com>2024-10-30 22:17:56 +0000
commit96eb609f6eb9558e2fab491a2c63a11bb0556471 (patch)
tree5f0522570f4da8f0261330d8fe6a02d5e0baa6af /pkg/vcs
parentfb888278a6b21eda7fa63551c83fd17b90305ba1 (diff)
pkg/build: add build command for starnix
Co-authored-by: eep@google.com
Diffstat (limited to 'pkg/vcs')
-rw-r--r--pkg/vcs/fuchsia.go11
-rw-r--r--pkg/vcs/vcs.go3
2 files changed, 10 insertions, 4 deletions
diff --git a/pkg/vcs/fuchsia.go b/pkg/vcs/fuchsia.go
index dfe4dc597..c2704c8ea 100644
--- a/pkg/vcs/fuchsia.go
+++ b/pkg/vcs/fuchsia.go
@@ -24,9 +24,12 @@ func newFuchsia(dir string, opts []RepoOpt) *fuchsia {
}
func (ctx *fuchsia) Poll(repo, branch string) (*Commit, error) {
- if repo != "https://fuchsia.googlesource.com" || branch != "master" {
- // Fuchsia ecosystem is hard-wired to the main repo.
- return nil, fmt.Errorf("fuchsia: can only check out https://fuchsia.googlesource.com/master")
+ if repo != "https://fuchsia.googlesource.com/fuchsia" || (branch != "main" && branch != "master") {
+ // Fuchsia ecosystem is hard-wired to the main repo + branch.
+ // The 'master' branch is a mirror of 'main'.
+ return nil, fmt.Errorf(
+ "fuchsia: can only check out 'main' or 'master' branch of https://fuchsia.googlesource.com/fuchsia",
+ )
}
if _, err := runSandboxed(ctx.dir, "./.jiri_root/bin/jiri", "update"); err != nil {
if err := ctx.initRepo(); err != nil {
@@ -48,7 +51,7 @@ func (ctx *fuchsia) initRepo() error {
if err := osutil.SandboxChown(tmpDir); err != nil {
return err
}
- cmd := "curl -s 'https://fuchsia.googlesource.com/fuchsia/+/master/scripts/bootstrap?format=TEXT' |" +
+ cmd := "curl -s 'https://fuchsia.googlesource.com/fuchsia/+/main/scripts/bootstrap?format=TEXT' |" +
"base64 --decode | bash"
if _, err := runSandboxed(tmpDir, "bash", "-c", cmd); err != nil {
return err
diff --git a/pkg/vcs/vcs.go b/pkg/vcs/vcs.go
index 17f54d653..cb32a4071 100644
--- a/pkg/vcs/vcs.go
+++ b/pkg/vcs/vcs.go
@@ -197,6 +197,9 @@ const (
func NewRepo(os, vmType, dir string, opts ...RepoOpt) (Repo, error) {
switch os {
case targets.Linux:
+ if vmType == targets.Starnix {
+ return newFuchsia(dir, opts), nil
+ }
return newLinux(dir, opts, vmType), nil
case targets.Fuchsia:
return newFuchsia(dir, opts), nil