Skip to content

Commit

Permalink
Fix wrong break (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Sep 25, 2019
1 parent f76a052 commit dd21732
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion analyzer/pkg/rpm/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ func (a rpmPkgAnalyzer) Analyze(fileMap extractor.FileMap) (pkgs []analyzer.Pack
if !detected {
return nil, analyzer.ErrNoPkgsDetected
}
return pkgs, xerrors.Errorf("failed to parse the pkg info: %w", err)
if err != nil {
return nil, xerrors.Errorf("failed to parse the pkg info: %w", err)
}
return pkgs, nil
}

func (a rpmPkgAnalyzer) parsePkgInfo(packageBytes []byte) (pkgs []analyzer.Package, err error) {
Expand Down
5 changes: 4 additions & 1 deletion analyzer/pkg/rpmcmd/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ func (a rpmCmdPkgAnalyzer) Analyze(fileMap extractor.FileMap) (pkgs []analyzer.P
if !detected {
return pkgs, analyzer.ErrNoPkgsDetected
}
return pkgs, xerrors.Errorf("failed to parse the pkg info: %w", err)
if err != nil {
return nil, xerrors.Errorf("failed to parse the pkg info: %w", err)
}
return pkgs, nil
}

func (a rpmCmdPkgAnalyzer) parsePkgInfo(packageBytes []byte) (pkgs []analyzer.Package, err error) {
Expand Down
2 changes: 1 addition & 1 deletion extractor/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ func (d DockerExtractor) ExtractFiles(layer io.Reader, filenames []string) (extr
if s[len(s)-1] == '/' {
if filepath.Clean(s) == filepath.Dir(filePath) {
extract = true
break
}
break
}

if s == filePath || s == fileName || strings.HasPrefix(fileName, wh) {
Expand Down

0 comments on commit dd21732

Please sign in to comment.