| Index: cipd/client/cipd/client.go
|
| diff --git a/cipd/client/cipd/client.go b/cipd/client/cipd/client.go
|
| index 9df889c5a8ac494f3ada014b21b04564eb247cba..b9036a4aec386d649a5274835a70ffe8740ce5d3 100644
|
| --- a/cipd/client/cipd/client.go
|
| +++ b/cipd/client/cipd/client.go
|
| @@ -42,7 +42,6 @@ import (
|
| "os"
|
| "path/filepath"
|
| "regexp"
|
| - "runtime"
|
| "sort"
|
| "strings"
|
| "sync"
|
| @@ -774,27 +773,14 @@ const clientPackageBase = "infra/tools/cipd"
|
| var clientPackage = ""
|
| var clientFileName = ""
|
|
|
| -var platformExpansion = ""
|
| -var archExpansion = ""
|
| -
|
| func init() {
|
| - // TODO(iannucci): rationalize these to just be exactly GOOS and GOARCH.
|
| - platformExpansion = runtime.GOOS
|
| - if platformExpansion == "darwin" {
|
| - platformExpansion = "mac"
|
| - }
|
| -
|
| clientFileName = "cipd"
|
| - if platformExpansion == "windows" {
|
| + if common.CurrentPlatform() == "windows" {
|
| clientFileName = "cipd.exe"
|
| }
|
|
|
| - archExpansion = runtime.GOARCH
|
| - if archExpansion == "arm" {
|
| - archExpansion = "armv6l"
|
| - }
|
| - clientPackage = fmt.Sprintf("%s/%s-%s", clientPackageBase, platformExpansion,
|
| - archExpansion)
|
| + clientPackage = fmt.Sprintf("%s/%s-%s", clientPackageBase,
|
| + common.CurrentPlatform(), common.CurrentArchitecture())
|
| }
|
|
|
| func (client *clientImpl) ensureClientVersionInfo(ctx context.Context, fs local.FileSystem, pin common.Pin, exePath string) {
|
| @@ -1254,7 +1240,7 @@ func (client *clientImpl) ProcessEnsureFile(ctx context.Context, r io.Reader) ([
|
| }
|
|
|
| logging.Debugf(ctx, "scanning ensure file with platform=%q, arch=%q",
|
| - platformExpansion, archExpansion)
|
| + common.CurrentPlatform(), common.CurrentArchitecture())
|
|
|
| out := []common.Pin{}
|
| scanner := bufio.NewScanner(r)
|
| @@ -1280,7 +1266,8 @@ func (client *clientImpl) ProcessEnsureFile(ctx context.Context, r io.Reader) ([
|
| return nil, makeError("expecting '<package template> <version>' line")
|
| }
|
|
|
| - pkg, err := expandTemplate(tokens[0], platformExpansion, archExpansion)
|
| + pkg, err := expandTemplate(tokens[0], common.CurrentPlatform(),
|
| + common.CurrentArchitecture())
|
| switch err {
|
| case nil:
|
| case errSkipTemplate:
|
|
|