Merge lp:~niemeyer/juju-core/halve-tools-tarball-size into lp:~juju/juju-core/trunk
Proposed by
Gustavo Niemeyer
Status: | Merged |
---|---|
Merged at revision: | 578 |
Proposed branch: | lp:~niemeyer/juju-core/halve-tools-tarball-size |
Merge into: | lp:~juju/juju-core/trunk |
Diff against target: |
59 lines (+21/-10) 2 files modified
environs/tools.go (+16/-7) environs/tools_test.go (+5/-3) |
To merge this branch: | bzr merge lp:~niemeyer/juju-core/halve-tools-tarball-size |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
The Go Language Gophers | Pending | ||
Review via email: mp+126364@code.launchpad.net |
Description of the change
environs: halve tools tarball size
Strip jujud and jujuc and do not add the "juju" command
to the tarball. This drops the tarball size by 50%+.
To post a comment you must log in.
Reviewers: mp+126364_ code.launchpad. net,
Message:
Please take a look.
Description:
environs: halve tools tarball size
Strip jujud and jujuc and do not add the "juju" command
to the tarball. This drops the tarball size by 50%+.
https:/ /code.launchpad .net/~niemeyer/ juju-core/ halve-tools- tarball- size/+merge/ 126364
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6579043/
Affected files: tools_test. go
A [revision details]
M environs/tools.go
M environs/
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: environs/tools.go
=== modified file 'environs/tools.go'
--- environs/tools.go 2012-09-21 14:41:58 +0000
+++ environs/tools.go 2012-09-26 02:08:23 +0000
@@ -437,19 +437,28 @@
}
defer os.RemoveAll(dir)
- cmd := exec.Command("go", "install", "launchpad. net/juju- core/cmd/ ...") os.Environ( ), "GOBIN="+dir) put() net/juju- core/cmd/ jujud"} , net/juju- core/cmd/ jujuc"} , os.Environ( ), "GOBIN="+dir) args[0] , args[1:]...) put() WriteFile( filepath. Join(dir, "FORCE-VERSION"), (*vers) .String( )), 0666); err != nil { filepath. Join(dir, "jujud"), "version") put() filepath. Join(dir, "jujud"), "version") put()
- cmd.Env = setenv(
- out, err := cmd.CombinedOut
- if err != nil {
- return version.Binary{}, fmt.Errorf("build failed: %v; %s", err, out)
+ cmds := [][]string{
+ {"go", "install", "launchpad.
+ {"go", "install", "launchpad.
+ {"strip", dir + "/jujud"},
+ {"strip", dir + "/jujuc"},
+ }
+ env := setenv(
+ for _, args := range cmds {
+ cmd := exec.Command(
+ cmd.Env = env
+ out, err := cmd.CombinedOut
+ if err != nil {
+ return version.Binary{}, fmt.Errorf("build failed: %v; %s", err, out)
+ }
}
if vers != nil {
if err := ioutil.
[]byte(
return version.Binary{}, err
}
}
- cmd = exec.Command(
- out, err = cmd.CombinedOut
+ cmd := exec.Command(
+ out, err := cmd.CombinedOut
if err != nil {
return version.Binary{}, fmt.Errorf("cannot get version
from %q: %v; %s", cmd.Args[0], err, out)
}
Index: environs/ tools_test. go tools_test. go' tools_test. go 2012-09-21 11:45:08 +0000 tools_test. go 2012-09-26 02:08:23 +0000 "jujud" , "arble"},
=== modified file 'environs/
--- environs/
+++ environs/
@@ -60,10 +60,12 @@
cmd []string
output string
}{
+ // TODO(niemeyer): Reintroduce this once we start deploying to the public
bucket.
+ //{
+ // []string{"juju", "arble"},
+ // "error: unrecognized command: juju arble\n",
+ //},
{
- []string{"juju", "arble"},
- "error: unrecognized command: juju arble\n",
- }, {
[]string{
"error: unrecognized command: jujud arble\n",
}, {