pkg/vcs: add akaros support

This commit is contained in:
Dmitry Vyukov 2018-07-05 13:02:10 +02:00
parent 3a35170a24
commit 8ebdf5923d
2 changed files with 63 additions and 0 deletions

61
pkg/vcs/akaros.go Normal file
View File

@ -0,0 +1,61 @@
// Copyright 2018 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package vcs
import (
"fmt"
"io"
"path/filepath"
)
type akaros struct {
git *git
dropbear *git
}
func newAkaros(vm, dir string) *akaros {
return &akaros{
git: newGit("", vm, dir),
dropbear: newGit("", vm, filepath.Join(dir, "dropbear")),
}
}
func (ctx *akaros) Poll(repo, branch string) (*Commit, error) {
if _, err := ctx.dropbear.Poll("https://github.com/akaros/dropbear-akaros", "akaros"); err != nil {
return nil, err
}
return ctx.git.Poll(repo, branch)
}
func (ctx *akaros) CheckoutBranch(repo, branch string) (*Commit, error) {
return nil, fmt.Errorf("not implemented for akaros")
}
func (ctx *akaros) CheckoutCommit(repo, commit string) (*Commit, error) {
return nil, fmt.Errorf("not implemented for akaros")
}
func (ctx *akaros) SwitchCommit(commit string) (*Commit, error) {
return nil, fmt.Errorf("not implemented for akaros")
}
func (ctx *akaros) HeadCommit() (*Commit, error) {
return nil, fmt.Errorf("not implemented for akaros")
}
func (ctx *akaros) ListRecentCommits(baseCommit string) ([]string, error) {
return nil, nil
}
func (ctx *akaros) ExtractFixTagsFromCommits(baseCommit, email string) ([]FixCommit, error) {
return nil, fmt.Errorf("not implemented for akaros")
}
func (ctx *akaros) Bisect(bad, good string, trace io.Writer, pred func() (BisectResult, error)) (*Commit, error) {
return nil, fmt.Errorf("not implemented for akaros")
}
func (ctx *akaros) PreviousReleaseTags(commit string) ([]string, error) {
return nil, fmt.Errorf("not implemented for akaros")
}

View File

@ -77,6 +77,8 @@ func NewRepo(os, vm, dir string) (Repo, error) {
switch os {
case "linux":
return newGit(os, vm, dir), nil
case "akaros":
return newAkaros(vm, dir), nil
case "fuchsia":
return newFuchsia(vm, dir), nil
}