Issue #145: Disabling the code scanning for dependencies when not managed by something else
diff --git a/cmd/flatten.go b/cmd/flatten.go index d24fd54..cb55674 100644 --- a/cmd/flatten.go +++ b/cmd/flatten.go
@@ -7,7 +7,6 @@ "strings" "github.com/Masterminds/cookoo" - "github.com/Masterminds/glide/util" "github.com/Masterminds/glide/yaml" "github.com/Masterminds/semver" ) @@ -261,66 +260,66 @@ // for dependencies. So generally it should be the last merge strategy // that you try. func mergeGuess(dir, pkg string, deps map[string]*yaml.Dependency, vend string, scanned map[string]bool) ([]string, bool) { - Info("Scanning %s for dependencies.", pkg) - buildContext, err := GetBuildContext() - if err != nil { - Warn("Could not scan package %q: %s", pkg, err) - return []string{}, false - } - - res := []string{} - - if _, err := os.Stat(dir); err != nil { - Warn("Directory is missing: %s", dir) - return res, true - } - - d := walkDeps(buildContext, dir, pkg) - for _, oname := range d { - if _, ok := scanned[oname]; ok { - //Info("===> Scanned %s already. Skipping", name) - continue - } - Info("=> Scanning %s", oname) - name, _ := NormalizeName(oname) - //if _, ok := deps[name]; ok { - //scanned[oname] = true - //Debug("====> Seen %s already. Skipping", name) - //continue - //} - - repo := util.GetRootFromPackage(name) - found := findPkg(buildContext, name, dir) - switch found.PType { - case ptypeUnknown: - Info("==> Unknown %s (%s)", name, oname) - Debug("✨☆ Undownloaded dependency: %s", name) - nd := &yaml.Dependency{ - Name: name, - Repository: "https://" + repo, - } - deps[name] = nd - res = append(res, name) - case ptypeGoroot, ptypeCgo: - scanned[oname] = true - // Why do we break rather than continue? - break - default: - // We're looking for dependencies that might exist in $GOPATH - // but not be on vendor. We add any that are on $GOPATH. - if _, ok := deps[name]; !ok { - Debug("✨☆ GOPATH dependency: %s", name) - nd := &yaml.Dependency{Name: name} - deps[name] = nd - res = append(res, name) - } - scanned[oname] = true - } - } - - return res, true - //Info("Package %s manages its own dependencies", pkg) - //return []string{}, true + // Info("Scanning %s for dependencies.", pkg) + // buildContext, err := GetBuildContext() + // if err != nil { + // Warn("Could not scan package %q: %s", pkg, err) + // return []string{}, false + // } + // + // res := []string{} + // + // if _, err := os.Stat(dir); err != nil { + // Warn("Directory is missing: %s", dir) + // return res, true + // } + // + // d := walkDeps(buildContext, dir, pkg) + // for _, oname := range d { + // if _, ok := scanned[oname]; ok { + // //Info("===> Scanned %s already. Skipping", name) + // continue + // } + // Info("=> Scanning %s", oname) + // name, _ := NormalizeName(oname) + // //if _, ok := deps[name]; ok { + // //scanned[oname] = true + // //Debug("====> Seen %s already. Skipping", name) + // //continue + // //} + // + // repo := util.GetRootFromPackage(name) + // found := findPkg(buildContext, name, dir) + // switch found.PType { + // case ptypeUnknown: + // Info("==> Unknown %s (%s)", name, oname) + // Debug("✨☆ Undownloaded dependency: %s", name) + // nd := &yaml.Dependency{ + // Name: name, + // Repository: "https://" + repo, + // } + // deps[name] = nd + // res = append(res, name) + // case ptypeGoroot, ptypeCgo: + // scanned[oname] = true + // // Why do we break rather than continue? + // break + // default: + // // We're looking for dependencies that might exist in $GOPATH + // // but not be on vendor. We add any that are on $GOPATH. + // if _, ok := deps[name]; !ok { + // Debug("✨☆ GOPATH dependency: %s", name) + // nd := &yaml.Dependency{Name: name} + // deps[name] = nd + // res = append(res, name) + // } + // scanned[oname] = true + // } + // } + // + // return res, true + Info("Package %s manages its own dependencies", pkg) + return []string{}, true } // mergeDeps merges any dependency array into deps.