pkg-ugprade checksums

From: Sysadmin Lists <sysadmin.lists_at_mailfence.com>
Date: Tue, 30 May 2023 09:22:49 UTC
How does pkg-upgrade check checksums?

From man 8 pkg-upgrade:

     Packages are fetched from the repositories into the local package cache
     if they are not already present, or if the checksum of the cached package
     file differs from the one in the repository.

But, the packagesite.yaml of my Poudriere repo has:
"name":"vim-x11"
"version":"9.0.1366"
"sum":"ae560492c77e7629a4c7b8162b256acbd39e4656c55516afcb8729121afc94dd"

And the locally cached package has:
# sha256 -r /var/cache/pkg/vim-x11*
3bbe31951bc5fd6b08c412fcb0c6f8b494cdb15eafdd4bbacdf1657fe567af43 /var/cache/pkg/vim-x11-9.0.1366.pkg

Yet it doesn't get upgraded:

# pkg update -fr Poudriere-quarterly
Updating Poudriere-quarterly repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01    
Fetching packagesite.pkg: 100%  153 KiB 157.1kB/s    00:01    
Processing entries: 100%
Poudriere-quarterly repository update completed. 568 packages processed.
All repositories are up to date.

# pkg upgrade -r Poudriere-quarterly vim-x11
Updating Poudriere-quarterly repository catalogue...
Poudriere-quarterly repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
Your packages are up to date.

# truss -fs 256 pkg update -fr Poudriere-quarterly 
Shows packagesite.yaml.pkg downloaded to /tmp/, presumably runs its checks,
then deletes it.

If I force re-installation, it downloads the new package and installs it.
# pkg install -fr Poudriere-quarterly vim-x11 

So, why is pkg-upgrade's checksums check failing? And why isn't there a
persistent packagesite.pkg on the client for pkg-update to compare to (to see
if it needs updating) as implied by:

     Package repository catalogues will be automatically updated whenever pkg
     upgrade is run by a user ID with write access to the package database

I looked at pkghash.h and upgrade.c but don't see where the hash check is
failing.


-- 
Sent with https://mailfence.com  
Secure and private email