[pacman-dev] [PATCH] pacman/query.c : -Qo optimization.

Xavier shiningxc at gmail.com
Mon Nov 26 16:17:09 EST 2007


On Mon, Nov 26, 2007 at 03:09:44PM -0600, Aaron Griffin wrote:
> On Nov 25, 2007 2:24 PM, Dan McGee <dpmcgee at gmail.com> wrote:
> > I feel like their could be an edge case where something breaks and
> > this shortcut bites us. However, I can't figure out out. Anyone else?
> > Otherwise this makes a lot of sense.
> 
> I don't think so.
> 
> operation 1 : check basename
> if same
>     operation 2 : check full path
>         if same
>             tada!
> 
> The only edge cases are when basename matches, but the full path does
> not, which is covered anyway.
> 
> Personally, I think this is a brilliant idea on Xavier's part, so keep
> up the good work.
> 
> Also, make sure to note what Dan mentioned about basename (we want to
> try and be cross-platform here whenever possible)
> 

Oh, sorry, we discussed this with Dan on IRC, and then I was willing to
answer the mail so that others can follow, and totally forgot.
When Dan asked me about these edge cases, I wasn't sure what to answer. But
when thinking back about it later, I thought about something similar to what
you just did for proving it was correct, so thanks :)

About the basename, I did what Dan asked, move mbasename from pacman.c to
util.c , and then use that instead.
That change and the Qo patch are both already in master.




More information about the pacman-dev mailing list