Difference between packagesite.txz, packagesite.pkg and data.pkg?

Hey,

I've been using my local caching nginx-based mirror for speeding up the package installation in my jails. I've created scripts around checking the necessity of package upgrades withing these jails.

When I run my `jails-pkg-upgrade.sh` script, it will force the nginx cache to reload the package indexes by passing in an extra header, that nginx listens to:

Code:
ABI=$(pkg config abi)

curl -v --fail-with-body -s -H 'Cache-Bypass: true' -o /dev/null "http://mirror.hostname/${ABI}/latest/packagesite.txz"
curl -v --fail-with-body -s -H 'Cache-Bypass: true' -o /dev/null "http://mirror.hostname/${ABI}/latest/packagesite.pkg"
curl -v --fail-with-body -s -H 'Cache-Bypass: true' -o /dev/null "http://mirror.hostname/${ABI}/latest/meta.conf"

I've even created a python script that will force-redownload packages that are in a broken state in the cache.

Recently I started to notice that pkg started to use a new package file "data.pkg", because my installations were broken again, the reason of which were the outdated cache.

So I've added the force-revalidation of this file too:
Code:
curl -v --fail-with-body -s -H 'Cache-Bypass: true' -o /dev/null "http://mirror.hostname/${ABI}/latest/data.pkg"

Now the question remains: which file is actually used to discover packages from? The program I linked above uses the former files to revalidate packages. I'm not sure if I'll have to change it to use data.pkg.

Can anyone enlighten me about this?
 
From the linked commit:

* replace packagesite.pkg with data.pkg (new extensible format)

An example line from packagesite.yaml within a packagesite.pkg for pkgbase:

Code:
{"name":"FreeBSD-runtime","origin":"base","version":"15.snap20240816202038","comment":"FreeBSD Base System","maintainer":"re@FreeBSD.org","www":"https://www.FreeBSD.org","abi":"FreeBSD:15:amd64","arch":"freebsd:15:x86:64","prefix":"/","sum":"f30038f0c4b39928899da77f2c2ac72f18675098dea7f1987e4d2c7400de4085","flatsize":9016814,"path":"FreeBSD-runtime-15.snap20240816202038.pkg","repopath":"FreeBSD-runtime-15.snap20240816202038.pkg","licenselogic":"single","licenses":["BSD2CLAUSE"],"pkgsize":2570338,"vital":true,"desc":"FreeBSD Base System","categories":["base"],"shlibs_required":["libc.so.7","libtinfow.so.9","libm.so.5","libedit.so.8","libcrypto.so.30","libarchive.so.7","libbsm.so.3","libthr.so.3"],"shlibs_provided":["lib80211.so.1","libbsdxml.so.4","libcam.so.7","libcap_dns.so.2","libcap_fileargs.so.1","libcap_grp.so.1","libcap_netdb.so.1","libcap_pwd.so.1","libcap_sysctl.so.2","libcap_syslog.so.1","libcasper.so.1","libcrypt.so.5","libelf.so.2","libgeom.so.5","libipsec.so.4","libjail.so.1","libkiconv.so.4","libkvm.so.7","libmd.so.6","libnv.so.1","libsbuf.so.6","libutil.so.9","libxo.so.0","libz.so.6","libgssapi.so.10","libpam.so.6","libprivatezstd.so.5","libregex.so.1","librpcsvc.so.5","libypclnt.so.4"],"annotations":{"FreeBSD_version":"1500023"}}

An identical string exists within data within the data.pkg
 
Back
Top