]> Cypherpunks repositories - gostls13.git/commitdiff
misc/dashboard/builder: reinstate 'go get -d' error handling hack
authorAndrew Gerrand <adg@golang.org>
Mon, 17 Sep 2012 18:21:02 +0000 (11:21 -0700)
committerAndrew Gerrand <adg@golang.org>
Mon, 17 Sep 2012 18:21:02 +0000 (11:21 -0700)
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

misc/dashboard/builder/main.go

index 8c6b65caeb60931ebb87861375d643c6ae65abda..5e30115edf12670179959b0b29db57be7258148a 100644 (file)
@@ -360,7 +360,13 @@ func (b *Builder) buildSubrepo(goRoot, pkg, hash string) (string, error) {
                err = fmt.Errorf("go exited with status %d", status)
        }
        if err != nil {
-               return log, err
+               // '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
+               }
        }
 
        // hg update to the specified hash