Restored ignore handling to be the same as prior to the rearchitecture - It ignores both a package and any sub-packages. This was the previous functionality. - Checks for ignores in the resolver rather than things it calls. This will reduce the amount of time we check for ignores.
diff --git a/cfg/config.go b/cfg/config.go index 17b1e95..cca4072 100644 --- a/cfg/config.go +++ b/cfg/config.go
@@ -101,7 +101,10 @@ // HasIgnore returns true if the given name is listed on the ignore list. func (c *Config) HasIgnore(name string) bool { for _, v := range c.Ignore { - if v == name { + + // Check for both a name and to make sure sub-packages are ignored as + // well. + if v == name || strings.HasPrefix(name, v+"/") { return true } }
diff --git a/dependency/resolver.go b/dependency/resolver.go index 46dd3da..e08f738 100644 --- a/dependency/resolver.go +++ b/dependency/resolver.go
@@ -287,6 +287,10 @@ for e := queue.Front(); e != nil; e = e.Next() { dep := e.Value.(string) t := strings.TrimPrefix(e.Value.(string), r.VendorDir+string(os.PathSeparator)) + if r.Config.HasIgnore(t) { + msg.Info("Ignoring: %s", t) + continue + } r.VersionHandler.Process(t) //msg.Warn("#### %s ####", dep) //msg.Info("Seen Count: %d", len(r.seen))
diff --git a/repo/installer.go b/repo/installer.go index d69e811..c3db217 100644 --- a/repo/installer.go +++ b/repo/installer.go
@@ -310,9 +310,6 @@ if root == m.RootPackage { return false, nil } - if m.Config.HasIgnore(root) || m.Config.HasIgnore(pkg) { - return false, nil - } dest := filepath.Join(m.destination, root) @@ -354,9 +351,6 @@ if root == m.RootPackage { return false, nil } - if m.Config.HasIgnore(root) || m.Config.HasIgnore(pkg) { - return false, nil - } msg.Info("Copying package %s from the GOPATH.", pkg) dest := filepath.Join(m.destination, pkg) @@ -410,9 +404,6 @@ if root == d.RootPackage { return nil } - if d.Config.HasIgnore(root) || d.Config.HasIgnore(pkg) { - return nil - } // We have not tried to import, yet. // Should we look in places other than the root of the project? @@ -450,9 +441,6 @@ if root == d.RootPackage { return nil } - if d.Config.HasIgnore(root) || d.Config.HasIgnore(pkg) { - return nil - } v := d.Config.Imports.Get(root)