Bug 285178 - ports-mgmt/packagekit: packages with mismatched checksums
Summary: ports-mgmt/packagekit: packages with mismatched checksums
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-05 14:33 UTC by Denis Shaposhnikov
Modified: 2025-03-12 15:25 UTC (History)
2 users (show)

See Also:
adridg: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Shaposhnikov 2025-03-05 14:33:17 UTC
Hi,

daily I see in my mail:

Checking for packages with mismatched checksums:
PackageKit-1.2.8: /var/lib/PackageKit/transactions.db

I'm not sure /var/lib/PackageKit/transactions.db should be included into port's pkg-plist.
Comment 1 Adriaan de Groot freebsd_committer freebsd_triage 2025-03-05 22:49:11 UTC
If we compare the RPM spec (which is part of the source distribution) with how we package this on FreeBSD, rpm says

%ghost %verify(not md5 size mtime) %{_localstatedir}/lib/PackageKit/transactions.db


That means "this file is not added to the package, but it is owned by the package and should be removed when the package is removed; for package-integrity purposes do not check the checksum, size or modification times (but do check other attributes, like file owner)."

So you are correct that we **should not** be checking this file. I don't know whether "remove from the plist" is the right solution, or some clever bit of plist-hackery.
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2025-03-11 10:24:21 UTC
This notion does not exist in pkg, and I am not sure if it really makes sense in terms of package semantic, but I can be convinced otherwise.

is this DB automatically created if it does not exist ? if yes then it should just not be installed only the directory should be part of the packaging (which btw in freebsd's world should have been /var/db/PackageKit instead of /var/lib/PackageKit).

rpm uses %ghost for this
which mean the file belong to a package is deleted by the package when the package is removed, but is not listed as part of the package, I am not sure I find this semantic consistent.

archlinux uses a mecanism similar to @sample or almost (it is probably saner than %ghost, but needs to be studied).

The best would be to create the file at installation time, or even better packagekit creates it itself if it does not find it.
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-03-12 15:25:38 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ee6a9aba3178a193d8b3a72bbd52f7914dad7b3a

commit ee6a9aba3178a193d8b3a72bbd52f7914dad7b3a
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-03-12 15:23:54 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-03-12 15:24:42 +0000

    ports-mgmt/packagekit: Use @sample on transaction.db file to avoid checksum warnings

    PR:             285178

 ports-mgmt/packagekit/Makefile  | 4 ++++
 ports-mgmt/packagekit/pkg-plist | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)