1
0
mirror of https://github.com/golang/go synced 2024-11-25 06:07:58 -07:00

misc/dashboard/builder: reinstate 'go get -d' error handling hack

I thought this was redundant since the behavior of 'go get -d' had
changed. I was wrong. Should have tested more thoroughly.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6500136
This commit is contained in:
Andrew Gerrand 2012-09-17 11:21:02 -07:00
parent da1ce83732
commit af832ac0b9

View File

@ -360,8 +360,14 @@ func (b *Builder) buildSubrepo(goRoot, pkg, hash string) (string, error) {
err = fmt.Errorf("go exited with status %d", status) err = fmt.Errorf("go exited with status %d", status)
} }
if err != nil { if err != nil {
// 'go get -d' will fail for a subrepo because its top-level
// directory does not contain a go package. No matter, just
// check whether an hg directory exists and proceed.
hgDir := filepath.Join(goRoot, "src/pkg", pkg, ".hg")
if fi, e := os.Stat(hgDir); e != nil || !fi.IsDir() {
return log, err return log, err
} }
}
// hg update to the specified hash // hg update to the specified hash
pkgPath := filepath.Join(goRoot, "src/pkg", pkg) pkgPath := filepath.Join(goRoot, "src/pkg", pkg)