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

Commit

Permalink
Log a warning, if we cannont infer a constrain; includes minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RaviTezu committed Aug 24, 2017
1 parent 25e1d69 commit b28420b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/dep/govend_importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (g *govendImporter) load(projectDir string) error {
g.logger.Println("Detected govend configuration files...")
y := filepath.Join(projectDir, govendYAMLName)
if g.verbose {
g.logger.Printf(" Loading %s", y)
g.logger.Printf(" Loading %s", y)
}
yb, err := ioutil.ReadFile(y)
if err != nil {
Expand All @@ -97,7 +97,7 @@ func (g *govendImporter) convert(pr gps.ProjectRoot) (*dep.Manifest, *dep.Lock,
for _, pkg := range g.yaml.Imports {
// Path must not be empty
if pkg.Path == "" || pkg.Revision == "" {
return nil, nil, errors.New("Invalid govend configuration, Path or Rev is required")
return nil, nil, errors.New("Invalid govend configuration, Path and Rev are required")
}

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

0 comments on commit b28420b

Please sign in to comment.