Delta packages

Sean Eric Fagan sef at Kithrup.COM
Wed May 14 16:21:22 UTC 2014


Matthew Seaman <m.seaman at infracaninophile.co.uk> wrote:
>full-fledged delta package we'd probably be thinking in terms of
>generating some sort of diff between old and new manifests.

I've already got a tool to do that.

(What it actually does is copy all the bits I can from the new manifest, and
copy all the new or modified files and directories from the new one, and
generate a list of rm/rmdir's for the deleted files and directories.  The
intent is that, afterwards, it should look just as if you'd installed the new
version.  As an example, however:  the txz file for python27 had the new
version at 4.4mbytes; the delta file just about half that.)

>    * upgrade package foo-1.0.0 to foo-1.0.1
>    * automatically produces delta/foo-1.0.1-1.0.0.txz
>    * should there be problems with foo-1.0.1 can then rollback by
>    applying the delta package.

Hah.  I hadn't thought about making the reverse, but the code doesn't care,
doesn't it?

>> Second question:  Any objections to it in principal?
>
>On the contrary.  This would make a really great addition.  Please do
>send patches / pull requests.

I'd hoped for some assistance with it, as the pkg code is pretty ... large :).

As I said, I've got something to create the delta files, so I guess I'll start
looking at modifying the package code.

The things I know it needs to do are:

* The manifest needs a key/value indicating what the old version is.
* It needs to extract the files, replacing any that are modified (and updating
their checksum/owner/group/mode as necessary).
* Then it needs to update the package version with the new version.

(If I can't get the pkg code to do it, I can do all of that manually with a
large hammer.  I'd prefer not to, obviously.)



More information about the freebsd-pkg mailing list