1
0
mirror of https://github.com/golang/go synced 2024-11-18 20:14:43 -07:00

go.tools/dashboard: Don't keep unversioned directories in gcc copy.

`svn update` would fail if the updated files were in the gcc/libgo or gcc/go/gofrontend because unrevisioned versions of those files had been inserted in the last build of gcc.

R=adg, adg
CC=golang-dev
https://golang.org/cl/14299043
This commit is contained in:
Chris Manghane 2013-10-02 15:56:27 -07:00
parent 691b055ea6
commit 63365376db

View File

@ -133,6 +133,8 @@ type gccgoEnv struct{}
func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (string, error) {
gofrontendpath := filepath.Join(workpath, "gofrontend")
gccpath := filepath.Join(repo.Path, "gcc")
gccgopath := filepath.Join(gccpath, "gcc", "go", "gofrontend")
gcclibgopath := filepath.Join(gccpath, "libgo")
// get a handle to SVN vcs.Cmd for pulling down GCC.
svn := vcs.ByCmd("svn")
@ -145,6 +147,15 @@ func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (st
}); err != nil {
return "", err
}
} else {
// make sure to remove gccgopath and gcclibgopath before
// updating the repo to avoid file clobbering.
if err := os.RemoveAll(gccgopath); err != nil {
return "", err
}
if err := os.RemoveAll(gcclibgopath); err != nil {
return "", err
}
}
if err := svn.Download(gccpath); err != nil {
return "", err
@ -155,9 +166,7 @@ func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (st
return "", err
}
// remove gccpath/gcc/go/gofrontend and gcc/libgo
gccgopath := filepath.Join(gccpath, "gcc", "go", "gofrontend")
gcclibgopath := filepath.Join(gccpath, "libgo")
// remove gccgopath and gcclibgopath before copying over gofrontend.
if err := os.RemoveAll(gccgopath); err != nil {
return "", err
}
@ -191,7 +200,6 @@ func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (st
}
return gccobjdir, nil
}
// copyDir copies the src directory into the dst