Skip to content

Commit

Permalink
Expand deb cataloger to include opkg (anchore#1985)
Browse files Browse the repository at this point in the history
* Add opkg info directory and status file to deb cataloger

opkg uses the same or nearly the same metadata and structure as Debian:
**/lib/opkg/status lists status information for all packages
**/lib/opkg/info/opkg.conffiles is a list of configuration files
**/lib/opkg/info/*.list contains files and directories installed by the package
**/lib/opkg/info/*.preinst are scripts to run before installation
**/lib/opkg/info/*.postinst are scripts to run after installation
**/lib/opkg/info/*.postrm are scripts to run after package removal
**/lib/opkg/info/*.control provides package metadata

Signed-off-by: Nicholas R. Smith <[email protected]>

---------

Signed-off-by: Nicholas R. Smith <[email protected]>
Co-authored-by: Nicholas R. Smith <[email protected]>
  • Loading branch information
Nicholas R. Smith and Nicholas R. Smith authored Aug 3, 2023
1 parent 8ba2174 commit 4b87a29
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syft/pkg/cataloger/deb/cataloger.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ func NewDpkgdbCataloger() *generic.Cataloger {
return generic.NewCataloger(catalogerName).
// note: these globs have been intentionally split up in order to improve search performance,
// please do NOT combine into: "**/var/lib/dpkg/{status,status.d/*}"
WithParserByGlobs(parseDpkgDB, "**/var/lib/dpkg/status", "**/var/lib/dpkg/status.d/*")
WithParserByGlobs(parseDpkgDB, "**/var/lib/dpkg/status", "**/var/lib/dpkg/status.d/*", "**/lib/opkg/info/*", "**/lib/opkg/status")
}
2 changes: 2 additions & 0 deletions syft/pkg/cataloger/deb/cataloger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ func TestCataloger_Globs(t *testing.T) {
expected: []string{
"var/lib/dpkg/status",
"var/lib/dpkg/status.d/pkg-1.0",
"usr/lib/opkg/status",
"usr/lib/opkg/info/pkg-1.0",
},
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bogus package
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bogus status

0 comments on commit 4b87a29

Please sign in to comment.