Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/detection/packages/packages.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ typedef struct FFPackagesResult {
uint32_t pkg;
uint32_t pkgsrc;
uint32_t pkgtool;
uint32_t porg;
uint32_t rpm;
uint32_t scoopGlobal;
uint32_t scoopUser;
Expand Down
3 changes: 3 additions & 0 deletions src/detection/packages/packages_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,9 @@ static void getPackageCounts(FFstrbuf* baseDir, FFPackagesResult* packageCounts,
if (FF_PACKAGES_IS_ENABLED(options, PKGTOOL)) {
packageCounts->pkgtool += getNumElements(baseDir, "/var/log/packages", false);
}
if (FF_PACKAGES_IS_ENABLED(options, PORG)) {
packageCounts->porg += getNumElements(baseDir, "/var/log/porg", false);
}
if (FF_PACKAGES_IS_ENABLED(options, RPM)) {
// `Sigmd5` is the only table that doesn't contain the virtual `gpg-pubkey` package
packageCounts->rpm += getSQLite3Int(baseDir, "/var/lib/rpm/rpmdb.sqlite", "SELECT count(*) FROM Sigmd5", "rpm");
Expand Down
1 change: 1 addition & 0 deletions src/modules/packages/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ typedef enum FF_A_PACKED FFPackagesFlags {
FF_PACKAGES_FLAG_MOSS_BIT = UINT64_C(1) << 32U,
FF_PACKAGES_FLAG_APPIMAGE_BIT = UINT64_C(1) << 33U,
FF_PACKAGES_FLAG_CARDS_BIT = UINT64_C(1) << 34U,
FF_PACKAGES_FLAG_PORG_BIT = UINT64_C(1) << 35U,
FF_PACKAGES_FLAG_FORCE_UNSIGNED = UINT64_MAX,
} FFPackagesFlags;
static_assert(sizeof(FFPackagesFlags) == sizeof(uint64_t), "");
Expand Down
6 changes: 6 additions & 0 deletions src/modules/packages/packages.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ bool ffPrintPackages(FFPackagesOptions* options) {
FF_PRINT_PACKAGE(pkg)
FF_PRINT_PACKAGE(pkgsrc)
FF_PRINT_PACKAGE(pkgtool)
FF_PRINT_PACKAGE(porg)
FF_PRINT_PACKAGE(rpm)
if (options->combined) {
FF_PRINT_PACKAGE_ALL(scoop);
Expand Down Expand Up @@ -181,6 +182,7 @@ bool ffPrintPackages(FFPackagesOptions* options) {
FF_ARG(counts.pkg, "pkg"),
FF_ARG(counts.pkgsrc, "pkgsrc"),
FF_ARG(counts.pkgtool, "pkgtool"),
FF_ARG(counts.porg, "porg"),
FF_ARG(counts.rpm, "rpm"),
FF_ARG(counts.scoopGlobal, "scoop-global"),
FF_ARG(counts.scoopUser, "scoop-user"),
Expand Down Expand Up @@ -319,6 +321,7 @@ void ffParsePackagesJsonObject(FFPackagesOptions* options, yyjson_val* module) {
FF_TEST_PACKAGE_NAME(PKG)
FF_TEST_PACKAGE_NAME(PKGSRC)
FF_TEST_PACKAGE_NAME(PKGTOOL)
FF_TEST_PACKAGE_NAME(PORG)
break;
case 'R':
if (false)
Expand Down Expand Up @@ -402,6 +405,7 @@ void ffGeneratePackagesJsonConfig(FFPackagesOptions* options, yyjson_mut_doc* do
FF_TEST_PACKAGE_NAME(PKG)
FF_TEST_PACKAGE_NAME(PKGSRC)
FF_TEST_PACKAGE_NAME(PKGTOOL)
FF_TEST_PACKAGE_NAME(PORG)
FF_TEST_PACKAGE_NAME(RPM)
FF_TEST_PACKAGE_NAME(SCOOP)
FF_TEST_PACKAGE_NAME(SNAP)
Expand Down Expand Up @@ -468,6 +472,7 @@ bool ffGeneratePackagesJsonResult(FFPackagesOptions* options, yyjson_mut_doc* do
FF_APPEND_PACKAGE_COUNT(pkg)
FF_APPEND_PACKAGE_COUNT(pkgsrc)
FF_APPEND_PACKAGE_COUNT(pkgtool)
FF_APPEND_PACKAGE_COUNT(porg)
FF_APPEND_PACKAGE_COUNT(rpm)
FF_APPEND_PACKAGE_COUNT(scoopGlobal)
FF_APPEND_PACKAGE_COUNT(scoopUser)
Expand Down Expand Up @@ -543,6 +548,7 @@ FFModuleBaseInfo ffPackagesModuleInfo = {
{ "Number of pkg packages", "pkg" },
{ "Number of pkgsrc packages", "pkgsrc" },
{ "Number of pkgtool packages", "pkgtool" },
{ "Number of porg packages", "porg" },
{ "Number of rpm packages", "rpm" },
{ "Number of scoop-global packages", "scoop-global" },
{ "Number of scoop-user packages", "scoop-user" },
Expand Down
Loading