Page MenuHomeFreeBSD

pkgbase: Add incremental package
ClosedPublic

Authored by manu on Aug 7 2020, 8:54 AM.

Details

Reviewers
None
Group Reviewers
pkgbase
Commits
rS367277: pkgbase: Add incremental packages
Summary

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

  1. There is now a PKG_VERSION directory with latest link pointing to it
  2. Distribute the packages to server

$ something something that update the source tree
$ make buildworld ...
$ make buildkernel
$ make update-packages
You know have a PKG_VERSION 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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

manu requested review of this revision.Aug 7 2020, 8:54 AM
0mp added inline comments.
Makefile.inc1
1848 ↗(On Diff #75543)

Why is it cd ${.CURDIR} && make ... instead of make -C ${.CURDIR}?

Makefile.inc1
1848 ↗(On Diff #75543)

Because it's done like that everywhere in this file.

Makefile.inc1
1848 ↗(On Diff #75543)

Fair enough! Thanks!

Makefile.inc1
1831 ↗(On Diff #75543)

This echo + subshell here are probably unnecessary.

Simplify update no need for PKG_TIMESTAMP and kernel works.

Makefile.inc1
1831 ↗(On Diff #75596)

or commit that part first

manu marked 2 inline comments as done.Aug 11 2020, 8:43 AM

If a script (post-install, post-deinstall ...) changes we don't detect it

I wonder if we should print a message to stderr indicating that incremental packages are experimental / have some missing functionality e.g.

If a script (post-install, post-deinstall ...) changes we don't detect it

I wonder if we should print a message to stderr indicating that incremental packages are experimental / have some missing functionality e.g.

When we generate them you mean ?
If we add one at the end maybe people will read it but I'm unsure :)

When we generate them you mean ?

Yeah, that was my thought, although now that you ask perhaps a pkg message would be good - let users know there might be some issues.

I'll update this review so we use pkg query '%X' from pkg 1.15 to get the internal checksum of the package and check if we need to update it.

manu edited the summary of this revision. (Show Details)

Use pkg query '%X' to have the internal package checksum, any changes to a package except the version will produce a different hash.

Forgot to uncomment a line, we need the stage-package dep.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 2 2020, 6:24 PM
This revision was automatically updated to reflect the committed changes.