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

Commit b28420b

Browse files
committed
Log a warning, if we cannont infer a constrain; includes minor fixes
1 parent 25e1d69 commit b28420b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/dep/govend_importer.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (g *govendImporter) load(projectDir string) error {
7474
g.logger.Println("Detected govend configuration files...")
7575
y := filepath.Join(projectDir, govendYAMLName)
7676
if g.verbose {
77-
g.logger.Printf(" Loading %s", y)
77+
g.logger.Printf(" Loading %s", y)
7878
}
7979
yb, err := ioutil.ReadFile(y)
8080
if err != nil {
@@ -97,7 +97,7 @@ func (g *govendImporter) convert(pr gps.ProjectRoot) (*dep.Manifest, *dep.Lock,
9797
for _, pkg := range g.yaml.Imports {
9898
// Path must not be empty
9999
if pkg.Path == "" || pkg.Revision == "" {
100-
return nil, nil, errors.New("Invalid govend configuration, Path or Rev is required")
100+
return nil, nil, errors.New("Invalid govend configuration, Path and Rev are required")
101101
}
102102

103103
p, err := g.sm.DeduceProjectRoot(pkg.Path)
@@ -124,7 +124,8 @@ func (g *govendImporter) convert(pr gps.ProjectRoot) (*dep.Manifest, *dep.Lock,
124124
if pp.Constraint != nil {
125125
pc, err := g.buildProjectConstraint(pkg, pp.Constraint.String())
126126
if err != nil {
127-
return nil, nil, err
127+
g.logger.Printf("Unable to infer a constraint for revision %s for package %s: %s", pkg.Revision, pkg.Path, err.Error())
128+
continue
128129
}
129130
manifest.Constraints[pc.Ident.ProjectRoot] = gps.ProjectProperties{Constraint: pc.Constraint}
130131
}

0 commit comments

Comments
 (0)