Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: go/src/infra/tools/cipd/local/pkgdef.go

Issue 1129043003: cipd: Refactor client to make it more readable. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/tools/cipd/local/manifest_test.go ('k') | go/src/infra/tools/cipd/local/pkgdef_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/tools/cipd/local/pkgdef.go
diff --git a/go/src/infra/tools/cipd/pkgdef.go b/go/src/infra/tools/cipd/local/pkgdef.go
similarity index 97%
rename from go/src/infra/tools/cipd/pkgdef.go
rename to go/src/infra/tools/cipd/local/pkgdef.go
index 847a6bd28dd2cc33b819da4a002940a456caf064..f4da8c3aa158b1ff1d9632bc1940a7ff6cc2e7a3 100644
--- a/go/src/infra/tools/cipd/pkgdef.go
+++ b/go/src/infra/tools/cipd/local/pkgdef.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package cipd
+package local
import (
"fmt"
@@ -13,6 +13,8 @@ import (
"sort"
"github.com/go-yaml/yaml"
+
+ "infra/tools/cipd/common"
)
// PackageDef defines how exactly to build a package: what files to put into it,
@@ -61,7 +63,7 @@ func LoadPackageDef(r io.Reader, vars map[string]string) (out PackageDef, err er
}
// Validate package name right away.
- err = ValidatePackageName(out.Package)
+ err = common.ValidatePackageName(out.Package)
if err != nil {
return
}
@@ -108,7 +110,7 @@ func (def *PackageDef) FindFiles(cwd string) ([]File, error) {
}
}
- log.Info("Enumerating files to zip...")
+ log.Infof("Enumerating files to zip...")
for _, chunk := range def.Data {
// Individual file.
if chunk.File != "" {
@@ -191,7 +193,7 @@ func makeExclusionFilter(startDir string, patterns []string) (ScanFilter, error)
return func(abs string) bool {
rel, err := filepath.Rel(startDir, abs)
if err != nil {
- log.Warnf("Unexpected error when evaluating %s: %s", abs, err)
+ log.Warningf("Unexpected error when evaluating %s: %s", abs, err)
return true
}
// Do not evaluate paths outside of startDir.
« no previous file with comments | « go/src/infra/tools/cipd/local/manifest_test.go ('k') | go/src/infra/tools/cipd/local/pkgdef_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698