Merge pull request #364 from tzneal/master
Use case insensitive path comparison on Windows
diff --git a/dependency/resolver.go b/dependency/resolver.go
index 88b610a..2b919b0 100644
--- a/dependency/resolver.go
+++ b/dependency/resolver.go
@@ -10,6 +10,7 @@
"github.com/Masterminds/glide/cfg"
"github.com/Masterminds/glide/msg"
+ gpath "github.com/Masterminds/glide/path"
"github.com/Masterminds/glide/util"
)
@@ -296,6 +297,10 @@
// and moved.
l.PushBack(filepath.Join(r.VendorDir, filepath.FromSlash(imp)))
}
+ case LocRelative:
+ if strings.HasPrefix(imp, "./"+gpath.VendorDir) {
+ msg.Warn("Go package resolving will resolve %s without the ./%s/ prefix", imp, gpath.VendorDir)
+ }
}
}
@@ -788,6 +793,8 @@
// Why does a Google product get a special case build mode with a local
// package?
LocAppengine
+ // LocRelative indicates the packge is a relative directory
+ LocRelative
)
// PkgInfo represents metadata about a package found by the resolver.
@@ -824,6 +831,12 @@
Name: name,
}
+ if strings.HasPrefix(name, "./") || strings.HasPrefix(name, "../") {
+ info.Loc = LocRelative
+ r.findCache[name] = info
+ return info
+ }
+
// Check _only_ if this dep is in the current vendor directory.
p = filepath.Join(r.VendorDir, filepath.FromSlash(name))
if pkgExists(p) {
@@ -881,6 +894,12 @@
// https://blog.golang.org/the-app-engine-sdk-and-workspaces-gopath
info.Loc = LocAppengine
r.findCache[name] = info
+ } else if name == "context" {
+ // context is a package being added to the Go 1.7 standard library. Some
+ // packages, such as golang.org/x/net are importing it with build flags
+ // in files for go1.7. Need to detect this and handle it.
+ info.Loc = LocGoroot
+ r.findCache[name] = info
}
return info
diff --git a/tree/tree.go b/tree/tree.go
index 8f0a0b5..1d9def2 100644
--- a/tree/tree.go
+++ b/tree/tree.go
@@ -103,6 +103,11 @@
Name: name,
}
+ if strings.HasPrefix(name, "./") || strings.HasPrefix(name, "../") {
+ info.Loc = dependency.LocRelative
+ return info
+ }
+
// Recurse backward to scan other vendor/ directories
// If the cwd isn't an absolute path walking upwards looking for vendor/
// folders can get into an infinate loop.
@@ -167,6 +172,11 @@
// where Google products are playing with each other.
// https://blog.golang.org/the-app-engine-sdk-and-workspaces-gopath
info.Loc = dependency.LocAppengine
+ } else if name == "context" {
+ // context is a package being added to the Go 1.7 standard library. Some
+ // packages, such as golang.org/x/net are importing it with build flags
+ // in files for go1.7. Need to detect this and handle it.
+ info.Loc = dependency.LocGoroot
}
return info