1
0
mirror of https://github.com/golang/go synced 2024-11-21 11:24:39 -07:00

builder: reuse existing workspace if possible

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5690069
This commit is contained in:
Shenghou Ma 2012-02-22 15:39:53 -05:00 committed by Russ Cox
parent 213997a730
commit bb4a490928

View File

@ -94,15 +94,19 @@ func main() {
return
}
// set up work environment
if err := os.RemoveAll(*buildroot); err != nil {
log.Fatalf("Error removing build root (%s): %s", *buildroot, err)
}
if err := os.Mkdir(*buildroot, mkdirPerm); err != nil {
log.Fatalf("Error making build root (%s): %s", *buildroot, err)
}
if err := hgClone(hgUrl, goroot); err != nil {
log.Fatal("Error cloning repository:", err)
// set up work environment, use existing enviroment if possible
if hgRepoExists(goroot) {
log.Print("Found old workspace, will use it")
} else {
if err := os.RemoveAll(*buildroot); err != nil {
log.Fatalf("Error removing build root (%s): %s", *buildroot, err)
}
if err := os.Mkdir(*buildroot, mkdirPerm); err != nil {
log.Fatalf("Error making build root (%s): %s", *buildroot, err)
}
if err := hgClone(hgUrl, goroot); err != nil {
log.Fatal("Error cloning repository:", err)
}
}
if *commitFlag {