feat: Add R cataloger (#1790)

Add a cataloger that detects installed R packages by looking for DESCRIPTION
files. The base R package is now picked up in coverageImage tests in
test/cli/packages_cmd_test.go, so increment expected package counts for the
tests that use that image.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
This commit is contained in:
William Murphy
2023-05-10 12:30:11 -04:00
committed by GitHub
parent 0580328ad9
commit da3624644a
31 changed files with 2476 additions and 5 deletions
+6
View File
@@ -33,6 +33,7 @@ const (
PhpComposerPkg Type = "php-composer"
PortagePkg Type = "portage"
PythonPkg Type = "python"
Rpkg Type = "R-package"
RpmPkg Type = "rpm"
RustPkg Type = "rust-crate"
)
@@ -61,6 +62,7 @@ var AllPkgs = []Type{
PhpComposerPkg,
PortagePkg,
PythonPkg,
Rpkg,
RpmPkg,
RustPkg,
}
@@ -106,6 +108,8 @@ func (t Type) PackageURLType() string {
return "nix"
case NpmPkg:
return packageurl.TypeNPM
case Rpkg:
return packageurl.TypeCran
case RpmPkg:
return packageurl.TypeRPM
case RustPkg:
@@ -173,6 +177,8 @@ func TypeByName(name string) Type {
return LinuxKernelModulePkg
case "nix":
return NixPkg
case packageurl.TypeCran:
return Rpkg
default:
return UnknownPkg
}