1
0
mirror of https://github.com/golang/go synced 2024-11-25 07:47:56 -07:00

misc/dist: drop repetition in filenames, default to release tag

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6117066
This commit is contained in:
Andrew Gerrand 2012-04-26 13:25:53 -07:00
parent d8443d2e41
commit 029d62f5c0

12
misc/dist/bindist.go vendored
View File

@ -29,7 +29,7 @@ import (
) )
var ( var (
tag = flag.String("tag", "weekly", "mercurial tag to check out") tag = flag.String("tag", "release", "mercurial tag to check out")
repo = flag.String("repo", "https://code.google.com/p/go", "repo URL") repo = flag.String("repo", "https://code.google.com/p/go", "repo URL")
verbose = flag.Bool("v", false, "verbose output") verbose = flag.Bool("v", false, "verbose output")
upload = flag.Bool("upload", true, "upload resulting files to Google Code") upload = flag.Bool("upload", true, "upload resulting files to Google Code")
@ -209,14 +209,20 @@ func (b *Build) Do() error {
} }
// Create packages. // Create packages.
base := fmt.Sprintf("go.%s.%s-%s", version, b.OS, b.Arch) base := fmt.Sprintf("%s.%s-%s", version, b.OS, b.Arch)
if !strings.HasPrefix(base, "go") {
base = "go." + base
}
var targs []string var targs []string
switch b.OS { switch b.OS {
case "linux", "freebsd", "": case "linux", "freebsd", "":
// build tarball // build tarball
targ := base targ := base
if b.Source { if b.Source {
targ = fmt.Sprintf("go.%s.src", version) targ = fmt.Sprintf("%s.src", version)
if !strings.HasPrefix(targ, "go") {
targ = "go." + targ
}
} }
targ += ".tar.gz" targ += ".tar.gz"
err = makeTar(targ, work) err = makeTar(targ, work)