pkg clean size mismatch

Hi,
After
Code:
pkg update
I see a lot of size mismatches when I run
Code:
pkg clean

Just a snip:
Code:
All/firefox-30.0,1.txz         www/firefox          Size mismatch
All/geany-1.23.1_2.txz         devel/geany          Size mismatch
All/lcms-1.19_5,1.txz          graphics/lcms        Size mismatch
All/exiv2-0.24_1,1.txz         graphics/exiv2       Size mismatch

Why is that? I would like to burn my cache directory to a DVD to enable installations on other machines without the downloads. These would be removed if I ran
Code:
pkg clean
Thanks.
Code:
# uname -a
FreeBSD machine3.example.com 10.0-RELEASE-p6 FreeBSD 10.0-RELEASE-p6 #0: Tue Jun 24 07:47:37 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
 
They're 'old' versions of the packages. If some of those packages have been rebuild the size and checksum may not match even if the version is correct. A pkg-install(8) or pkg-upgrade(8) would need to download the new version from the repository anyway, so the 'old' ones can be removed.
 
That's by design, PKG keeps a cache of downloaded packages that is not cleaned up automatically when newer versions of packages are downloaded. Note that a package that is in the remote repository with the same version number but is compiled somewhat differently also considered new, those will trigger the "size mismatch" condition.
 
anund said:
Okay I see. In fact

Code:
pkg info firefox

shows that I installed it on Jun 21, and the rebuilt version at
http://pkg.freebsd.org/freebsd:10:x86:64/latest/All/
has a date of Jun 26

But when I run
Code:
pkg upgrade
it gives
Code:
Updating repository catalogue
Nothing to do

Shouldn't the rebuilt version get installed?

No, unless there's a change in the version number of the package or options used to build the package or dependencies to other packages. This means that for example if a build tool for a package gets changed without bumping the version number the resulting package will still be considered not updated even though there might be some subtle differences compared to the previous package.
 
Oh and sorry I forgot to mention this, the pkg-clean(8) functionality is implemented very naively to make it run very fast. It will only test version numbers of packages and sizes of the packages, that's why you will only see messages "superceded by version X" and "size mismatch". It will not check options or dependencies or do anything else that would require it to look inside the packages in finer detail.
 
Back
Top