Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 465e239

Browse files
committed
Merge branch 'govendor-importer' of github.com:kyleconroy/dep into govendor-importer
Conflicts: cmd/dep/govendor_importer.go
2 parents 912a53d + 58786bf commit 465e239

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

cmd/dep/govendor_importer.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,24 @@ func (g *govendorImporter) convert(pr gps.ProjectRoot) (*dep.Manifest, *dep.Lock
9999
}
100100

101101
if len(g.file.Ignore) > 0 {
102-
// TODO: Will this work for "test"?
103-
manifest.Ignored = strings.Split(g.file.Ignore, " ")
102+
// Govendor has three use cases here
103+
// 1. 'test' - special case for ignoring test files
104+
// 2. build tags - any string without a slash (/) in it
105+
// 3. path and path prefix - any string with a slash (/) in it.
106+
// The path case could be a full path or just a prefix.
107+
// Dep doesn't support build tags right now: https://github.com/golang/dep/issues/120
108+
for _, i := range strings.Split(g.file.Ignore, " ") {
109+
if !strings.Contains(i, "/") {
110+
g.logger.Printf("Warning: Not able to convert ignoring of build tag '%v'", i)
111+
continue
112+
}
113+
_, err := g.sm.DeduceProjectRoot(i)
114+
if err == nil {
115+
manifest.Ignored = append(manifest.Ignored, i)
116+
} else {
117+
g.logger.Println("Warning: Not able to convert ignoring of build tag '%v'", i)
118+
}
119+
}
104120
}
105121

106122
lock := &dep.Lock{}

cmd/dep/testdata/govendor/golden.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Detected govendor configuration files...
22
Converting from vendor.json...
3+
Warning: Not able to convert ignoring of build tag 'test'
34
Using ^0.8.1 as initial constraint for imported dep github.com/sdboyer/deptest
45
Trying v0.8.1 (3f4c3be) as initial lock for imported dep github.com/sdboyer/deptest
56
Using ^2.0.0 as initial constraint for imported dep github.com/sdboyer/deptestdos

0 commit comments

Comments
 (0)