[PC-BSD Pbi-dev] Delta PBIs?

Kris Moore kris at pcbsd.org
Mon Aug 23 08:46:45 PDT 2010

Hash: SHA1

On 08/23/2010 09:25, Jesse Smith wrote:
> -----Original Message-----
> From: Kris Moore <kris at pcbsd.org>
> To: pbi-dev at lists.pcbsd.org
> Subject: Re: [PC-BSD Pbi-dev] Delta PBIs?
> Date: Mon, 23 Aug 2010 09:04:34 -0400
> On 08/22/2010 20:05, Jesse Smith wrote:
>> I think most of the effort could be automated. Something along the line
>> of.
>> 1. New PBI package is made for program ABC.
>> 2. The old package is moved to a folder for "old versions".
>> 3. The new version is placed in the repo.
>> 4. A script figured out which files are different between the two and
>> creates a delta PBI file.
>> 5. The client's package manager checks to see if it has package ABC
>> version current -1. If it does, then it grabs the delta bundle. If it is
>> further out of date, it grabs the full version.
>> Of course, it always sounds easier on (virtual) paper, but I think the
>> over-all logic is fairly straight forward. Ideally, the packager
>> wouldn't have to do anything extra, the script would rotate out old
>> packages and create the delta. (And politicians would all be honest and
>> little girls would all get free ponies while I'm at it.)
>> - Jesse
> I think its possible for sure, I'll have to do some digging into it to
> see. All the files in the new PBI will be slightly different, just from
> date-n-time stamps alone, but much of the contents would be the same.
> I'll have to dig around and find a way to get a binary diff / delta of
> the entire PBI directory, which only copies different parts of the
> binary, not the full file :)
> ==========================
> I think that even if you just copied the files which had different
> contents, it would work. I mean, copy the entire file, not just the
> difference between File A-version1.0 and File A-version1.1. This could
> probably be done with the diff command. Because, I assume, most of the
> files in a PBI will be the same between minor versions.
> diff --brief file-1.0 file-1.1
> This will return TRUE if the files are identical or FALSE if the
> contents is different.
> So a script that compares each file might do something like
> diff --brief old-version/file new-version/file || cp new-version/file
> delta-folder/file
> Which would transfer a copy of the new version into the delta package,
> if the file has changed since the previous version.
> Just thinking out loud,
> Jesse

Thats what I want to avoid though :) The problem is that each binary /
library file usually has a timestamp from when it was built, somewhere
embedded in each file. This will make each of those files "differ" when
in reality nothing else is changed. As a result the only files which
will match will be scripts / raw data files, which tends to be smaller
stuff in the archive. I'll need a way make patch files for the binary /
library files themselves to get that small change without adding a lot
of duplicated bits.

Maybe the 'bsdiff' command will work out here :)

- -- 
Kris Moore
PC-BSD Software
Version: GnuPG v2.0.15 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the Pbi-dev mailing list