Index: agent/tools/list.go |
=== renamed file 'environs/tools/list.go' => 'agent/tools/list.go' |
--- environs/tools/list.go 2013-05-02 15:55:42 +0000 |
+++ agent/tools/list.go 2013-07-22 03:40:11 +0000 |
@@ -4,16 +4,15 @@ |
package tools |
import ( |
- "launchpad.net/juju-core/log" |
- "launchpad.net/juju-core/state" |
+ "strings" |
+ |
"launchpad.net/juju-core/utils/set" |
"launchpad.net/juju-core/version" |
- "strings" |
) |
// List holds tools available in an environment. The order of tools within |
// a List is not significant. |
-type List []*state.Tools |
+type List []*Tools |
// String returns the versions of the tools in src, separated by semicolons. |
func (src List) String() string { |
@@ -26,21 +25,21 @@ |
// Series returns all series for which some tools in src were built. |
func (src List) Series() []string { |
- return src.collect(func(tools *state.Tools) string { |
+ return src.collect(func(tools *Tools) string { |
return tools.Series |
}) |
} |
// Arches returns all architectures for which some tools in src were built. |
func (src List) Arches() []string { |
- return src.collect(func(tools *state.Tools) string { |
+ return src.collect(func(tools *Tools) string { |
return tools.Arch |
}) |
} |
// collect calls f on all values in src and returns an alphabetically |
// ordered list of the returned results without duplicates. |
-func (src List) collect(f func(*state.Tools) string) []string { |
+func (src List) collect(f func(*Tools) string) []string { |
var seen set.Strings |
for _, tools := range src { |
seen.Add(f(tools)) |
@@ -98,7 +97,7 @@ |
} |
} |
if len(result) == 0 { |
- log.Errorf("environs/tools: cannot match %#v", f) |
+ logger.Errorf("cannot match %#v", f) |
return nil, ErrNoMatches |
} |
return result, nil |
@@ -125,7 +124,7 @@ |
} |
// match returns true if the supplied tools match f. |
-func (f Filter) match(tools *state.Tools) bool { |
+func (f Filter) match(tools *Tools) bool { |
if f.Released && tools.IsDev() { |
return false |
} |