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 PKG_VERSION=1.0 PKG_TIMESTAMP=<dateofrelease>
# Distribute the packages to server
$ something something that update the source tree
$ make buildworld ...
$ make buildkernel
$ make update-packages PKG_VERSION=1.1 PKG_TIMESTAMP=<dateof1.1release> PKG_VERSION_FROM=1.0 PKG_TIMESTAMP_FROM=<dateofrelease>
Rince and repeat for each 1.X
You know have a 1.1 directory in the REPODIR and latest link pointing to it.
In 1.1 only the packages which differs from 1.0 are named 1.1, otherwise the old packages are there.
PKG_VERSION format doesn't matter, this could have been 13.0 and then 13.0p1, 13.0p2 ...
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.
If the old and new version matches, we rm the new package and cp the old one.
If not we store the new package to build in the packages.mk so it will be rebuilt.
When we have the list of packages that needs to be rebuild we rebuild them, they will have the new timestamp and the new version.
There is two cavehats for now:
Kernel is always rebuild, this is done in another make rules and for now was left as a todo
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.