Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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 @@ -10,6 +10,7 @@ typedef struct FFPackagesResult {
uint32_t appimage;
uint32_t brew;
uint32_t brewCask;
uint32_t cards;
uint32_t choco;
uint32_t dpkg;
uint32_t emerge;
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 @@ -537,6 +537,9 @@ static void getPackageCounts(FFstrbuf* baseDir, FFPackagesResult* packageCounts,
if (!(options->disabled & FF_PACKAGES_FLAG_MOSS_BIT)) {
packageCounts->moss += getSQLite3Int(baseDir, "/.moss/db/state", "SELECT COUNT(*) FROM state_selections WHERE state_id = (SELECT MAX(id) FROM state)", "moss");
}
if (!(options->disabled & FF_PACKAGES_FLAG_CARDS_BIT)) {
packageCounts->cards += getNumElements(baseDir, "/var/lib/pkg/DB", true);
}
}

static void getPackageCountsRegular(FFstrbuf* baseDir, FFPackagesResult* packageCounts, FFPackagesOptions* options) {
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 @@ -38,6 +38,7 @@ typedef enum FF_A_PACKED FFPackagesFlags {
FF_PACKAGES_FLAG_KISS_BIT = 1ULL << 31,
FF_PACKAGES_FLAG_MOSS_BIT = 1ULL << 32,
FF_PACKAGES_FLAG_APPIMAGE_BIT = 1ULL << 33,
FF_PACKAGES_FLAG_CARDS_BIT = 1ULL << 34,
FF_PACKAGES_FLAG_FORCE_UNSIGNED = UINT64_MAX,
} FFPackagesFlags;
static_assert(sizeof(FFPackagesFlags) == sizeof(uint64_t), "");
Expand Down
4 changes: 4 additions & 0 deletions src/modules/packages/packages.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ bool ffPrintPackages(FFPackagesOptions* options) {
FF_PRINT_PACKAGE_NAME(brew, "brew")
FF_PRINT_PACKAGE_NAME(brewCask, "brew-cask")
}
FF_PRINT_PACKAGE(cards)
FF_PRINT_PACKAGE(choco)
FF_PRINT_PACKAGE(dpkg)
Comment on lines +64 to 66
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cards was added to the default printed list/JSON result, but it isn’t exposed to the custom outputFormat path (missing FF_ARG(counts.cards, "cards") in the FF_PRINT_FORMAT_CHECKED argument list) and it’s also missing from ffPackagesModuleInfo.formatArgs. As a result, {cards} can’t be used in user-defined formats even though the manager is supported.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tnut Please address Copilot's comment.

FF_PRINT_PACKAGE(emerge)
Expand Down Expand Up @@ -247,6 +248,7 @@ void ffParsePackagesJsonObject(FFPackagesOptions* options, yyjson_val* module) {
case 'C':
if (false)
;
FF_TEST_PACKAGE_NAME(CARDS)
FF_TEST_PACKAGE_NAME(CHOCO)
break;
case 'D':
Expand Down Expand Up @@ -371,6 +373,7 @@ void ffGeneratePackagesJsonConfig(FFPackagesOptions* options, yyjson_mut_doc* do
FF_TEST_PACKAGE_NAME(APK)
FF_TEST_PACKAGE_NAME(APPIMAGE)
FF_TEST_PACKAGE_NAME(BREW)
FF_TEST_PACKAGE_NAME(CARDS)
FF_TEST_PACKAGE_NAME(CHOCO)
FF_TEST_PACKAGE_NAME(DPKG)
FF_TEST_PACKAGE_NAME(EMERGE)
Expand Down Expand Up @@ -429,6 +432,7 @@ bool ffGeneratePackagesJsonResult(FF_A_UNUSED FFPackagesOptions* options, yyjson
FF_APPEND_PACKAGE_COUNT(apk)
FF_APPEND_PACKAGE_COUNT(brew)
FF_APPEND_PACKAGE_COUNT(brewCask)
FF_APPEND_PACKAGE_COUNT(cards)
FF_APPEND_PACKAGE_COUNT(choco)
FF_APPEND_PACKAGE_COUNT(dpkg)
FF_APPEND_PACKAGE_COUNT(emerge)
Expand Down
Loading