[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [GSoC] blends-gen-control hints (Was: blends-dev, gsoc 2013)



Hi,

On Thu, Jul 11, 2013 at 08:41:29PM +0300, Emmanouil Kiagias wrote:
> > >
> > > query="""
> > >                  SELECT DISTINCT provides, p.distribution, component,
> > > r.sort FROM packages p
> > >                   JOIN releases r ON p.release = r.release
> > >                   WHERE provides SIMILAR TO '{0}|{0},%|% {0} %|% {0}, %'
> > >                   ORDER BY r.sort DESC
> > >                   LIMIT 1
> > > """.format('djvu-viewer')
> > >
> > > A "similar to"  with multiple OR statements inside to cover our cases:
> > > single OR virtual, % OR % virtual % OR % virtual.
> > > At first it looks fine, I need to make more tests. This example does not
> > > catch "freeb" and catches correctly the "djvu-viewer"
> > > Let me know what you think.
> >
> > Uhm, need to cope with the {0} syntax.  Meanwhile I've got a hint from a
> > (German) psql list:
> >
> >
> its :.. WHERE provides SIMILAR TO 'djvu-viewer|djvu-viewer,%|% djvu-viewer
>  %|% djvu-viewer, %'
> so {0} just replaces the first(0 index) element of the format() function
> which in our case is the 'djvu-viewer' string. it can be similar in the
> EXECUTE as : ...  WHERE provides SIMILAR TO '$1|$1,%|% $1 %|% $1, %'

Ahhh - I was somehow confused because I expected SQL syntax when you wrote
Python syntax.  Thanks for the explanation anyway.

> Anyway as you said everything that works is fine :-) .Are you going to
> commit the patch? Or we need to make more tests?

When I wrote my previous mail the importer incorporating the hint I have
taken over from the mailing list was just running and did a nice job as
I see now.  I commited the change and will now install on blends.d.n and
udd.d.o.

Kind regards

      Andreas.

-- 
http://fam-tille.de


Reply to: