[pacman-dev] [PATCH] Rework delta struct and modify code accordingly

Dan McGee dpmcgee at gmail.com
Sat Feb 16 12:26:38 EST 2008


On Feb 16, 2008 11:22 AM, Nathan Jones <nathanj at insightbb.com> wrote:
> On Fri, Feb 15, 2008 at 08:27:18PM -0600, Dan McGee wrote:
> > Note both my comments above in the commit message, as well as taking a look
> > at how not trying to even worry about the filename simplifies the code in
> > sync.c a good amount.
>
> The simplification is very nice. This will allow us to completely get
> rid of the patches list, which I always thought was a bit hacky.
>
> The main reason I wanted to keep the old version in addition to the
> filename is for the function pkg_upgrade_delta_path:
>
> static alpm_list_t *pkg_upgrade_delta_path(pmpkg_t *newpkg, pmdb_t *db_local)
<snip>

Take a look here:
http://code.toofishes.net/gitweb.cgi?p=pacman.git;a=commitdiff;h=afbf3f4058bebdefa1f96527f0de09af79e5ba39;hp=5c9452c45ecc4802afef80d2c2f7ba4b76ae89a6

I reworked this function quite a bit in my "second" patch.

> > +     tmp2 = tmp;
> > +     tmp = strchr(tmp, ' ');
> > +     *(tmp++) = '\0';
> > +     delta->delta_size = atol(tmp2);
> >
> >       return(delta);
> >  }

Yeah, I like segfaults. :P Also fixed in my second patch, although we
should probably make this a bit more resistant to malformed entries.

-Dan




More information about the pacman-dev mailing list