mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
support .kar files (#3113)
* add kar Signed-off-by: tomersein <tomersein@gmail.com>
This commit is contained in:
parent
c19cf626ab
commit
91cf066db6
5 changed files with 11 additions and 1 deletions
|
@ -108,7 +108,7 @@ func (a archiveFilename) extension() string {
|
|||
|
||||
func (a archiveFilename) pkgType() pkg.Type {
|
||||
switch strings.ToLower(a.extension()) {
|
||||
case "jar", "war", "ear", "lpkg", "par", "sar", "nar":
|
||||
case "jar", "war", "ear", "lpkg", "par", "sar", "nar", "kar":
|
||||
return pkg.JavaPkg
|
||||
case "jpi", "hpi":
|
||||
return pkg.JenkinsPluginPkg
|
||||
|
|
|
@ -86,6 +86,13 @@ func TestExtractInfoFromJavaArchiveFilename(t *testing.T) {
|
|||
name: "pkg-extra-field-maven",
|
||||
ty: pkg.JavaPkg,
|
||||
},
|
||||
{
|
||||
filename: "pkg-extra-field-maven-4.3.2-rc1.kar",
|
||||
version: "4.3.2-rc1",
|
||||
extension: "kar",
|
||||
name: "pkg-extra-field-maven",
|
||||
ty: pkg.JavaPkg,
|
||||
},
|
||||
{
|
||||
filename: "/some/path/pkg-extra-field-maven-4.3.2-rc1.jpi",
|
||||
version: "4.3.2-rc1",
|
||||
|
|
|
@ -31,6 +31,7 @@ var archiveFormatGlobs = []string{
|
|||
"**/*.nar",
|
||||
"**/*.jpi",
|
||||
"**/*.hpi",
|
||||
"**/*.kar",
|
||||
"**/*.lpkg", // Zip-compressed package used to deploy applications
|
||||
// (aka plugins) to Liferay Portal server. Those files contains .JAR(s) and a .PROPERTIES file, the latter
|
||||
// has information about the application and installation requirements.
|
||||
|
|
|
@ -23,6 +23,7 @@ func Test_ArchiveCataloger_Globs(t *testing.T) {
|
|||
"java-archives/example.par",
|
||||
"java-archives/example.sar",
|
||||
"java-archives/example.nar",
|
||||
"java-archives/example.kar",
|
||||
"java-archives/example.jpi",
|
||||
"java-archives/example.hpi",
|
||||
"java-archives/example.lpkg",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
example archive
|
Loading…
Reference in a new issue