Skip to content

Packages:add cards counting (NuTyX)#2287

Open
tnut wants to merge 5 commits intofastfetch-cli:devfrom
tnut:dev
Open

Packages:add cards counting (NuTyX)#2287
tnut wants to merge 5 commits intofastfetch-cli:devfrom
tnut:dev

Conversation

@tnut
Copy link
Copy Markdown

@tnut tnut commented Apr 25, 2026

Summary

Adding support for card package manager counting packages.

Changes

  • src/detection/packages/packages.h
  • src/detection/packages/packages_linux.c
  • src/modules/packages/option.h
  • src/modules/packages/packages.c

Checklist

  • [X ] I have tested my changes locally.

Comment thread src/modules/packages/packages.c Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for counting NuTyX “cards” packages in the Packages module.

Changes:

  • Introduces a new cards package count in the shared packages result struct.
  • Adds a new disable-flag bit for cards and wires it into JSON config parsing/generation.
  • Implements Linux detection for cards by counting entries under /var/lib/pkg/DB.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/modules/packages/packages.c Prints cards, supports disabling via JSON, and emits cards in JSON results.
src/modules/packages/option.h Adds FF_PACKAGES_FLAG_CARDS_BIT to allow disabling cards counting.
src/detection/packages/packages_linux.c Adds Linux-side counting logic for NuTyX cards (/var/lib/pkg/DB).
src/detection/packages/packages.h Adds cards field to FFPackagesResult.

Comment on lines +64 to 66
FF_PRINT_PACKAGE(cards)
FF_PRINT_PACKAGE(choco)
FF_PRINT_PACKAGE(dpkg)
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.

@copilot apply changes based on this feedback

@tnut
Copy link
Copy Markdown
Author

tnut commented Apr 26, 2026

Do I need to do anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants