From 77e6c6f886618d2844a28014aeac95d77ad24568 Mon Sep 17 00:00:00 2001 From: Marc CARRE Date: Mon, 30 Jan 2017 18:05:58 +0000 Subject: [PATCH 1/3] Upgrade to latest 'common' and 'build-tools'. If building against the latest 'build-tools', you would typically get: tools/runner/runner.go:18:2: cannot find package github.com/weaveworks/common/mflag This change fixes the issue by upgrading both dependencies. --- tools | 2 +- vendor/github.com/weaveworks/common | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools b/tools index a59884f3..36c1835b 160000 --- a/tools +++ b/tools @@ -1 +1 @@ -Subproject commit a59884f322173264bc088549899cad51a51d0a87 +Subproject commit 36c1835b4986c4c4d81a597156e7cd5c1a8e8b23 diff --git a/vendor/github.com/weaveworks/common b/vendor/github.com/weaveworks/common index 865a52c9..08ae9c83 160000 --- a/vendor/github.com/weaveworks/common +++ b/vendor/github.com/weaveworks/common @@ -1 +1 @@ -Subproject commit 865a52c9937cab1440aad535397c5f432f7dc1fc +Subproject commit 08ae9c839237b80dd6fd41b8570573d1528cec3b From 8f9b2a36c0669661974fcd841b9af1ee79bd9f13 Mon Sep 17 00:00:00 2001 From: Marc CARRE Date: Tue, 31 Jan 2017 10:30:12 +0000 Subject: [PATCH 2/3] Remove dep. on docker and use mflag from common. This reduces the number of dependencies, and avoids having docker as a vendored dependency, which should speed the build up. --- .gitmodules | 3 --- common/mflagext/listvar.go | 2 +- prog/weaveproxy/main.go | 2 +- prog/weaver/main.go | 2 +- vendor/github.com/weaveworks/docker | 1 - 5 files changed, 3 insertions(+), 7 deletions(-) delete mode 160000 vendor/github.com/weaveworks/docker diff --git a/.gitmodules b/.gitmodules index b3ee97cb..d653c81a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -79,9 +79,6 @@ [submodule "vendor/golang.org/x/sys"] path = vendor/golang.org/x/sys url = https://go.googlesource.com/sys -[submodule "vendor/github.com/weaveworks/docker"] - path = vendor/github.com/weaveworks/docker - url = https://github.com/weaveworks/docker [submodule "vendor/github.com/beorn7/perks"] path = vendor/github.com/beorn7/perks url = https://github.com/beorn7/perks diff --git a/common/mflagext/listvar.go b/common/mflagext/listvar.go index 6a3bf365..c385e2cd 100644 --- a/common/mflagext/listvar.go +++ b/common/mflagext/listvar.go @@ -3,7 +3,7 @@ package mflagext import ( "fmt" - "github.com/weaveworks/docker/pkg/mflag" + "github.com/weaveworks/common/mflag" ) type listOpts struct { diff --git a/prog/weaveproxy/main.go b/prog/weaveproxy/main.go index acce3bad..3f6b0644 100644 --- a/prog/weaveproxy/main.go +++ b/prog/weaveproxy/main.go @@ -5,8 +5,8 @@ import ( "os" "strings" + "github.com/weaveworks/common/mflag" "github.com/weaveworks/common/signals" - "github.com/weaveworks/docker/pkg/mflag" "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/common/mflagext" "github.com/weaveworks/weave/proxy" diff --git a/prog/weaver/main.go b/prog/weaver/main.go index 604a09fd..c4011d72 100644 --- a/prog/weaver/main.go +++ b/prog/weaver/main.go @@ -13,8 +13,8 @@ import ( "github.com/gorilla/mux" "github.com/pkg/profile" + "github.com/weaveworks/common/mflag" "github.com/weaveworks/common/signals" - "github.com/weaveworks/docker/pkg/mflag" "github.com/weaveworks/mesh" "github.com/weaveworks/weave/common" diff --git a/vendor/github.com/weaveworks/docker b/vendor/github.com/weaveworks/docker deleted file mode 160000 index 4dc5990d..00000000 --- a/vendor/github.com/weaveworks/docker +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4dc5990d7565a4a15d641bc6a0bc50a02cfcf302 From ee659d4033bbc8e4e2a51f17d6e808a72008a00c Mon Sep 17 00:00:00 2001 From: Marc CARRE Date: Tue, 31 Jan 2017 10:49:29 +0000 Subject: [PATCH 3/3] Replace weave/common/mflagext with common/mflagext. Removes duplication between weave and common and reduces the amount of sources to compile. --- common/mflagext/listvar.go | 31 ------------------------------- prog/weaveproxy/main.go | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 common/mflagext/listvar.go diff --git a/common/mflagext/listvar.go b/common/mflagext/listvar.go deleted file mode 100644 index c385e2cd..00000000 --- a/common/mflagext/listvar.go +++ /dev/null @@ -1,31 +0,0 @@ -package mflagext - -import ( - "fmt" - - "github.com/weaveworks/common/mflag" -) - -type listOpts struct { - value *[]string - hasBeenSet bool -} - -func ListVar(p *[]string, names []string, value []string, usage string) { - *p = value - mflag.Var(&listOpts{p, false}, names, usage) -} - -func (opts *listOpts) Set(value string) error { - if opts.hasBeenSet { - (*opts.value) = append((*opts.value), value) - } else { - (*opts.value) = []string{value} - opts.hasBeenSet = true - } - return nil -} - -func (opts *listOpts) String() string { - return fmt.Sprintf("%v", []string(*opts.value)) -} diff --git a/prog/weaveproxy/main.go b/prog/weaveproxy/main.go index 3f6b0644..bf326187 100644 --- a/prog/weaveproxy/main.go +++ b/prog/weaveproxy/main.go @@ -6,9 +6,9 @@ import ( "strings" "github.com/weaveworks/common/mflag" + "github.com/weaveworks/common/mflagext" "github.com/weaveworks/common/signals" "github.com/weaveworks/weave/common" - "github.com/weaveworks/weave/common/mflagext" "github.com/weaveworks/weave/proxy" )