On Fri, Feb 27, 2009 at 12:37 AM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On Thu, Feb 26, 2009 at 5:21 PM, Xavier <shiningxc@gmail.com> wrote:
On Thu, Feb 26, 2009 at 11:34 PM, Aaron Griffin <aaronmgriffin@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.
Hmm ok. So how do you control repo-add delta creation, do we need a new -d/--delta flag for it, or an environment variable REPO_DELTA=1 ? And where should repo-add assume that the oldfile is? Current working directory, same directory as the database, same directory as the package being added? And where should the newly created delta be put? Finally, db_remove_entry supports the odd corner case that there could be multiple entries for the same pkgname. How should delta creation deal with that? Only pick the first entry, or try to generate a delta for each entry? That is this kind of questions which bothers me the most, because I am never totally sure what the use case will be. You could be of a great help here :)
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?
The old package and new package can be anywhere. But the new delta will be put next to the new package. What would be the best output location for the new delta?