Commit 5a18aef6 authored by Andrew Gerrand's avatar Andrew Gerrand

goinstall: add -fix flag to run gofix on packages on build failure

goinstall: better error handling and reporting

R=r, r, rsc, mattn.jp
CC=golang-dev
https://golang.org/cl/5421051
parent 8e515485
...@@ -132,7 +132,7 @@ type RemoteRepo interface { ...@@ -132,7 +132,7 @@ type RemoteRepo interface {
// the part of the import path that forms the repository root, // the part of the import path that forms the repository root,
// and the version control system it uses. It may discover this // and the version control system it uses. It may discover this
// information by using the supplied client to make HTTP requests. // information by using the supplied client to make HTTP requests.
Repo(_ *http.Client) (url, root string, vcs *vcs, err error) Repo(*http.Client) (url, root string, vcs *vcs, err error)
} }
type host struct { type host struct {
...@@ -169,7 +169,7 @@ type baseRepo struct { ...@@ -169,7 +169,7 @@ type baseRepo struct {
vcs *vcs vcs *vcs
} }
func (r *baseRepo) Repo(_ *http.Client) (url, root string, vcs *vcs, err error) { func (r *baseRepo) Repo(*http.Client) (url, root string, vcs *vcs, err error) {
return r.url, r.root, r.vcs, nil return r.url, r.root, r.vcs, nil
} }
...@@ -345,7 +345,7 @@ type anyRepo struct { ...@@ -345,7 +345,7 @@ type anyRepo struct {
rootWithoutSuffix string rootWithoutSuffix string
} }
func (r *anyRepo) Repo(_ *http.Client) (url, root string, vcs *vcs, err error) { func (r *anyRepo) Repo(*http.Client) (url, root string, vcs *vcs, err error) {
if r.url != "" { if r.url != "" {
return r.url, r.root, r.vcs, nil return r.url, r.root, r.vcs, nil
} }
...@@ -458,13 +458,12 @@ func (v *vcs) updateRepo(repoPath string) error { ...@@ -458,13 +458,12 @@ func (v *vcs) updateRepo(repoPath string) error {
cmd := exec.Command(v.cmd, v.tagList) cmd := exec.Command(v.cmd, v.tagList)
cmd.Dir = repoPath cmd.Dir = repoPath
cmd.Stderr = stderr cmd.Stderr = stderr
b, err := cmd.Output() out, err := cmd.Output()
if err != nil { if err != nil {
errorf("%s %s: %s\n", v.cmd, v.tagList, stderr) return &RunError{strings.Join(cmd.Args, " "), repoPath, out, err}
return err
} }
var tags []string var tags []string
for _, m := range v.tagListRe.FindAllStringSubmatch(string(b), -1) { for _, m := range v.tagListRe.FindAllStringSubmatch(string(out), -1) {
tags = append(tags, m[1]) tags = append(tags, m[1])
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment