Commit 5d1c7bd1 authored by Andrew Gerrand's avatar Andrew Gerrand

misc/dist: add -version flag to override version name

Also, don't build the tour when making the source distribution.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/8354043
parent 2cf658f6
......@@ -37,6 +37,7 @@ var (
wxsFile = flag.String("wxs", "", "path to custom installer.wxs")
addLabel = flag.String("label", "", "additional label to apply to file when uploading")
includeRace = flag.Bool("race", true, "build race detector packages")
versionOverride = flag.String("version", "", "override version name")
username, password string // for Google Code upload
)
......@@ -184,11 +185,10 @@ func (b *Build) Do() error {
} else {
_, err = b.run(src, "bash", "make.bash")
}
}
if *includeRace {
if err != nil {
return err
}
if !b.Source && *includeRace {
goCmd := filepath.Join(b.root, "bin", "go")
if b.OS == "windows" {
goCmd += ".exe"
......@@ -200,12 +200,13 @@ func (b *Build) Do() error {
// Re-install std without -race, so that we're not left with
// a slower, race-enabled cmd/go, cmd/godoc, etc.
_, err = b.run(src, goCmd, "install", "-a", "std")
}
if err != nil {
return err
}
err = b.tour()
}
if err := b.tour(); err != nil {
if err != nil {
return err
}
......@@ -229,6 +230,9 @@ func (b *Build) Do() error {
fullVersion = bytes.TrimSpace(fullVersion)
v := bytes.SplitN(fullVersion, []byte(" "), 2)
version = string(v[0])
if *versionOverride != "" {
version = *versionOverride
}
// Write VERSION file.
err = ioutil.WriteFile(filepath.Join(b.root, "VERSION"), fullVersion, 0644)
......@@ -522,7 +526,12 @@ func (b *Build) Upload(version string, filename string) error {
ftype = "Source"
summary = fmt.Sprintf("%s (source only)", version)
}
labels = append(labels, "OpSys-"+opsys, "Type-"+ftype)
if opsys != "" {
labels = append(labels, "OpSys-"+opsys)
}
if ftype != "" {
labels = append(labels, "Type-"+ftype)
}
if *addLabel != "" {
labels = append(labels, *addLabel)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment