aboutsummaryrefslogtreecommitdiff
path: root/misc/makerelease
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2014-12-10 13:04:06 +1100
committerDavid Symonds <dsymonds@golang.org>2014-12-11 17:36:39 +1100
commita56a3876e8221ed125ffdd017efcbdded651d99b (patch)
treedbe4c73634376a30173c3dcca45a4ab92654c963 /misc/makerelease
parent026b5bbc8bf865324aed7a7746937e2dc3fa4903 (diff)
downloadgo-a56a3876e8221ed125ffdd017efcbdded651d99b.tar.xz
misc/makerelease: handle git sub-repositories
Also: checkout sub-repos from Mercurial manually instead of using "go get". (for the 1.4 release) LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/190720043
Diffstat (limited to 'misc/makerelease')
-rw-r--r--misc/makerelease/makerelease.go26
1 files changed, 21 insertions, 5 deletions
diff --git a/misc/makerelease/makerelease.go b/misc/makerelease/makerelease.go
index 43b1f3d115..1cb8df0517 100644
--- a/misc/makerelease/makerelease.go
+++ b/misc/makerelease/makerelease.go
@@ -505,15 +505,31 @@ func (b *Build) extras() error {
}
func (b *Build) get(repoPath, revision string) error {
- // Fetch the packages (without building/installing).
- _, err := b.run(b.gopath, filepath.Join(b.root, "bin", "go"),
- "get", "-d", repoPath+"/...")
- if err != nil {
- return err
+ dest := filepath.Join(b.gopath, "src", filepath.FromSlash(repoPath))
+
+ if strings.HasPrefix(repoPath, "golang.org/x/") {
+ // For sub-repos, fetch the old Mercurial repo; bypass "go get".
+ // DO NOT import this special case into the git tree.
+
+ if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil {
+ return err
+ }
+ repo := strings.Replace(repoPath, "golang.org/x/", "https://code.google.com/p/go.", 1)
+ if _, err := b.run(b.gopath, "hg", "clone", repo, dest); err != nil {
+ return err
+ }
+ } else {
+ // Fetch the packages (without building/installing).
+ _, err := b.run(b.gopath, filepath.Join(b.root, "bin", "go"),
+ "get", "-d", repoPath+"/...")
+ if err != nil {
+ return err
+ }
}
// Update the repo to the specified revision.
dest := filepath.Join(b.gopath, "src", filepath.FromSlash(repoPath))
+ var err error
switch {
case exists(filepath.Join(dest, ".git")):
_, err = b.run(dest, "git", "checkout", revision)