зеркало из https://github.com/golang/build.git
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:
Родитель
85b520b3b4
Коммит
bd95eb9e7d
|
@ -133,6 +133,8 @@ type gccgoEnv struct{}
|
||||||
func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (string, error) {
|
func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (string, error) {
|
||||||
gofrontendpath := filepath.Join(workpath, "gofrontend")
|
gofrontendpath := filepath.Join(workpath, "gofrontend")
|
||||||
gccpath := filepath.Join(repo.Path, "gcc")
|
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.
|
// get a handle to SVN vcs.Cmd for pulling down GCC.
|
||||||
svn := vcs.ByCmd("svn")
|
svn := vcs.ByCmd("svn")
|
||||||
|
@ -145,6 +147,15 @@ func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (st
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return "", err
|
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 {
|
if err := svn.Download(gccpath); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
@ -155,9 +166,7 @@ func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (st
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove gccpath/gcc/go/gofrontend and gcc/libgo
|
// remove gccgopath and gcclibgopath before copying over gofrontend.
|
||||||
gccgopath := filepath.Join(gccpath, "gcc", "go", "gofrontend")
|
|
||||||
gcclibgopath := filepath.Join(gccpath, "libgo")
|
|
||||||
if err := os.RemoveAll(gccgopath); err != nil {
|
if err := os.RemoveAll(gccgopath); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
@ -191,7 +200,6 @@ func (env *gccgoEnv) setup(repo *Repo, workpath, hash string, envv []string) (st
|
||||||
}
|
}
|
||||||
|
|
||||||
return gccobjdir, nil
|
return gccobjdir, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// copyDir copies the src directory into the dst
|
// copyDir copies the src directory into the dst
|
||||||
|
|
Загрузка…
Ссылка в новой задаче