Skip to content

RedHatProductSecurity/deplist

 
 

Repository files navigation

Tests

deplist

Scan and list the dependencies in a source code repository.

Supports:

  • Go
  • NodeJS
  • Python
  • Ruby
  • Java

Dependencies are printed in PackageURL format.

Requirements

On Fedora:

$ dnf install golang-bin yarnpkg maven rubygem-bundler ruby-devel gcc gcc-c++ npm

Command Line

Build from source

$ make
go build cmd/deplist/deplist.go

Run

$ ./deplist test/testRepo
pkg:npm/[email protected]
pkg:npm/[email protected]
pkg:npm/[email protected]
pkg:npm/[email protected]
...

Verbose/debug output:

 deplist -debug ./test/testRepo/
DEBU[0000] Checking ./test/testRepo/
DEBU[0000] GetRubyDeps test/testRepo/Gemfile
DEBU[0000] Running env [--chdir=test/testRepo ruby /tmp/gemfile-parser.rb927489446 .]
DEBU[0000] GetGoPkgDeps test/testRepo/Gopkg.lock
DEBU[0000] GetGlideDeps test/testRepo/glide.lock
DEBU[0000] GetGolangDeps test/testRepo/go.mod
...

API

The api functions as follows:

func GetDeps(fullPath string) ([]Dependency, Bitmask, error) {

Parameters

  • fullPath:

    Path to directory with source code.

Returns

  • Depenency:

    Array of Dependency structs from dependencies.go

  • Bitmask:

    A bitmask of found languages:

const (
	LangGolang = 1 << iota
	LangNodeJS
	LangPython
	LangRuby
)
  • error:

    Standard Go error handling

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 90.7%
  • Ruby 7.3%
  • Other 2.0%