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

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



On Thu, Jul 11, 2013 at 06:30:20PM +0300, Emmanouil Kiagias wrote:
> > Any idea?
> >
> > Oups I did not think of this case (like the "freeb" example). Instead of
> regex(to be honest I did not find anything new on this) I think this fits
> us:
> 
> 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:

udd=# SELECT DISTINCT provides, p.distribution, component, r.sort FROM packages p
                 JOIN releases r ON p.release = r.release
                 WHERE provides ~ '((\s|,)djvu-viewer(\s+|,|$)|^djvu-viewer$)'
;
  provides   | distribution | component |  sort  
-------------+--------------+-----------+--------
 djvu-viewer | debian       | main      |    700
 djvu-viewer | debian       | main      |    600
 djvu-viewer | debian       | main      |    800
 djvu-viewer | debian       | main      |      0
 djvu-viewer | debian       | main      | 100000
(5 Zeilen)

looks quite good.  Finally it does not matter - everything that works is fine.
I'll check later.

 
> PS: I have a local UDD instance, the extra "," was a mistake, probably from
> a copy paste without testing :-(

That's fine.

Kind regards

        Andreas.

-- 
http://fam-tille.de


Reply to: