This adds a new target update-packages which will create the new packages compared to the last run.
This is how to use it:
# At this point we cut a release
$ make buildworld ...
$ make buildkernel
$ make packages
# There is now a PKG_VERSION directory with latest link pointing to it
# Distribute the packages to server
$ something something that update the source tree
$ make buildworld ...
$ make buildkernel
$ make update-packages
You know have a PKG_VERISON directory in the REPODIR and latest link pointing to it.
In PKG_VERSION dir only the packages which differs from the latest run are named PKG_VERSION, otherwise the old packages are there.
The process is :
Build the new packages in the PKG_VERSION directory
Compare the internal data with the PKG_VERSION_FROM version. The comparison is done by checking the hash
of the files. By default PKG_VERSION_FROM is set to what the latest link points to.
If the old and new version matches, we rm the new package and cp the old one.
There is one caveat for now:
If a script (post-install, post-deinstall ...) changes we don't detect it, I think the best way to deal with this is to add to pkg-query a format that will print some kind of internal package hash (which could be a hash of all the data + scripts or something) and use this to compare the packages.