[pacman-dev] [PATCH] Remove alpm_dep_get_string usage from libalpm

Dan McGee dpmcgee at gmail.com
Mon Nov 19 13:54:40 EST 2007


On Nov 19, 2007 12:36 PM, Aaron Griffin <aaronmgriffin at gmail.com> wrote:
> On Nov 19, 2007 8:44 AM, Nagy Gabor <ngaba at bibl.u-szeged.hu> wrote:
> > > 2. There is something in my mind about alpm_dep_getstring:
> > > It shouldn't be used for debug preformat (or in libalpm at all); but that is
> > > good for front-ends.
> > > I would prefer the following more elegant(?) solution instead of switch():
> > > there is a global const char *deptypestr[] = {">=", "<=", "="} in the
> > > correct
> > > order somewhere; and from now on, you can pass deptypestr[dep->mod]
> > > parameter
> > > easily to alpm_log for example (see alpm_depcmp). This is O(1) (<- switch is
> > > also O(1), but that floods the code imho)
> > > I will create a patch for this, after I can sync my git repo ;-)
> > > Bye
>
> Hmmm. I think I actually like the alpm_dep_get_string function. I
> don't like the need to free the string afterwards, as it adds more
> mental book keeping into the mix.
>
> I'm a little torn here, as this patch is much less book keeping, but
> is a little... erm ,uglier.
>
> Anyone else have an opinion one way or the other?

I need to wait until I get home so I can actually inline and comment
on the patch...unless someone wants to resend it that way.

-Dan




More information about the pacman-dev mailing list