[pacman-dev] [PATCH] Add a fetch callback to allow front-end download support

Aaron Griffin aaronmgriffin at gmail.com
Thu Feb 19 12:03:22 EST 2009


On Thu, Feb 19, 2009 at 12:55 AM, Sebastian Nowicki <sebnow at gmail.com> wrote:
> This allows a frontend to define its own download algorithm so that the
> libfetch dependency can be omitted without using an external process.
> The callback will be used when if it is defined, otherwise the old
> behavior applies.

I like this, but my first thought is: why not extrapolate our current
downloading as a "fetch callback" too? That way the check just needs a
"!= NULL" before calling it, and it can be done on config parsing:

//in initialization
#ifdef INTERNAL_DOWNLOAD
   fetchcb = internal_fetch;
#else
   fetchcb = NULL;
#endif
...
...
// in config parsing
if(strcmp(blah, "XferCommand") == 0) {
   fetchcb = use_xfercommand;
}


More information about the pacman-dev mailing list