[pacman-dev] delta support in libalpm

Aaron Griffin aaronmgriffin at gmail.com
Thu Feb 26 18:37:45 EST 2009


On Thu, Feb 26, 2009 at 5:21 PM, Xavier <shiningxc at gmail.com> wrote:
> On Thu, Feb 26, 2009 at 11:34 PM, Aaron Griffin <aaronmgriffin at gmail.com> wrote:
>>
>> So, ok, from a db-scripts point of view, we're going to have to do the
>> following:
>>
>> when a new package is added:
>>   copy old package file from ftp to build dir
>>   generate delta from old file -> new file (in staging)
>
> $ oldfile=tzdata-2009a-1-x86_64.pkg.tar.gz
> $ newfile=tzdata-2009b-1-x86_64.pkg.tar.gz
> $ pkgdelta $oldfile $newfile
> ==> Generating delta from version 2009a-1 to version 2009b-1
> ==> Generated delta : 'tzdata-2009a-1_to_2009b-1-x86_64.delta'
...snip...
> Indeed, it should be possible to put that in repo-add, I seriously
> considered that option a while ago.
> But using pkgdelta and repo-add on delta files should be easy enough,
> as you can see above.

Hmm, actually this isn't as straightforward as it seems as we always
have the possibility that multiple pkg files exist (haven't been
cleaned up yet), so we need to determine the previous file's full
name. That's why I mentioned doing it in repo-add, as repo-add knows
the entry in the DB already and can very easily generate a new delta
before it removes the old entry.

To do this in the db-scripts, we need to open the existing DB, find
the entry for this pkgname, and get the filename. Does pkgdelta
correctly construct deltas in different directories, or do we also
need to copy the file next to the new package before running pkgdelta
need to be next to each other?


More information about the pacman-dev mailing list