Repository navigation
Packages (FreeBSD): adds flatpkg detection - #2778
Open
Tyagiquamar wants to merge 1 commit into
Open
Tyagiquamar wants to merge 1 commit into
Tyagiquamar wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
flatpkgcounter to the Packages module on FreeBSD. flatpkg is a clean-room Flatpak reimplementation for BSD systems; its package store at/var/db/flatpkgwas previously invisible to fastfetch.Closes #2720
Changes
src/detection/packages/packages_bsd.c: scans the flatpkg store (/var/db/flatpkg) using the layout from flatpkg's ownsrc/shared/store.c:app/<id>counts once when the app has a deployed revision (<id>/<arch>/<branch>/active, a symlink to the deploy dir thatstat()follows) or anapp/<id>/pointerfile, which is how flatpkg marks apps exported to the host.runtime/<id>/<arch>/<branch>counts once per branch that has anactivedeploy marker, so superseded deploys kept by flatpkg are not counted..Localeand.Debugrefs are skipped, matching the flatpak counting rules.extension/refs are not counted, matching flatpak behavior.src/detection/packages/packages.h: newflatpkgresult field (picked up by thealltotal automatically).src/modules/packages/option.h: newFF_PACKAGES_FLAG_FLATPKG_BIT(auto-wires thePACKAGES_DISABLE_FLATPKGCMake option and thedisabledJSON list via the existing regex).src/modules/packages/packages.c: prints(flatpkg)in text output, adds the{flatpkg}format placeholder, JSON result field, anddisabledlist support.doc/json_schema.json,CHANGELOG.md: documented.Only the system store is counted. flatpkg's per-user store lives at
~/.local/share/flatpak, which is shared with real Flatpak installs and uses the Flatpak layout, so it cannot be attributed to flatpkg unambiguously; the FreeBSD backend does not count Flatpak user installs today either.Tests
gcc -fsyntax-onlyonpackages_bsd.c(FreeBSD-only TU, not reachable from the Linux build) andpackages.c: clean.debian:trixie-slim,cmake -B build -DBUILD_TESTS=On):cmake --build buildsucceeded;ctest --output-on-failure: 21/21 tests passed.{flatpkg}resolves in--packages-format, appears in-h packages-format,disabled: ["flatpkg"]is accepted, and JSON output is unchanged on Linux (flatpkg is BSD-only).packages_bsd.cinto a scratch harness and pointed it at a synthetic/var/db/flatpkgstore (3 apps incl. one pointer-only, 1 deployed runtime, 1.Localeref, 1 undeployed branch, 1 extension). Result:flatpkg=4as expected;0when the store is absent.Note: the port-tree patch referenced in the issue (
ports/sysutils/fastfetch/files/patch-...in Poiesys/flatpkg) targets/var/lib/flatpkgand the Flatpakapp/<id>/currentlayout; the actual flatpkg store is/var/db/flatpkgwith<id>/<arch>/<branch>/activedeploy markers, so this implements the real layout instead.Checklist