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

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

Hi Emmanouil,

On Wed, Jul 10, 2013 at 08:10:21PM +0300, Emmanouil Kiagias wrote:
> I have attached the patches. For each package check you perform I just
> added an extra check using the "provides" column. This check gets active
> once the initial check fails, for example:
> Let's take the case where you check for the 'djvu-viewer' package (which is
> virtual)
> First you do:
> * EXECUTE blend_check_existing_package('djvu-viewer')
> This execute call won't return anything. Now instead of moving in the next
> : "blend_check_package_in_new" it goes to:
> * EXECUTE blend_check_existing_package_provides('%djvu-viewer%') --( I use
> "like" condition in where clause because "provides" might contain comma
> separated values).
>  This now returns a result so we set the contain_provides = 'true', if it
> fails(for another package) then it moves on to the next
> "blend_check_package_in_new" then goes to
> "blend_check_package_in_new_provides" and so on.
> It might look a little dirty but I think it will work.

The algorithm works in principle but the "like '%djvu-viewer%'" will not
work.  Here is a counter example:

udd=# SELECT DISTINCT provides, p.distribution, component, r.sort FROM packages p
udd-#                  JOIN releases r ON p.release = r.release
udd-#                  WHERE provides like '%freeb%'
udd-#                  ORDER BY r.sort DESC
udd-#                  LIMIT 1;

                     provides                     | distribution | component |  sort  
 lsb-printing-kfreebsd-amd64, lsb-printing-noarch | debian       | main      | 100000
(1 Zeile)

While I was considering this in the beginning when I tried to work
around this by using regular expression search as in my latest commit[1]

    query = """PREPARE blend_check_existing_package_provides AS
                 SELECT DISTINCT provides, p.distribution, component, r.sort FROM packages p
                 JOIN releases r ON p.release = r.release
                 WHERE provides ~ ('[ ,]*'||$1||'[ ,]*')
                 ORDER BY r.sort DESC
                 LIMIT 1"""

this very query is featuring exactly the same problem because it catches
the same result.  So I'm currently wondering how to precisely design the
regular expression to match only full words $1.  If we don't do this we
have several "fake" virtual packages which are actually prospective

For the moment I failed fiddling around with regexps - just want to let
you know.  Feel free to try your luck with better regexp that makes sure
we get no result when $1 = 'freeb'  (or 'ipath' and others).

BTW, it seems you have no running UDD instance running at your side
because there was a typo in the SQL script (additional ',') of your
patch.  If this was just a simple mistake and you in principle can test
your code running against an UDD instance that's OK (it was easy to spot
anyway).  In case you don't have access to an UDD clone we should change
this by enabling you to use blends.debian.net or perhaps the just
announced public UDD mirror[2].

Kind regards


[1] http://anonscm.debian.org/gitweb/?p=collab-qa/udd.git;a=commitdiff;h=c7a8e49113ec98dafc23160143a7a4ec89791d02
[2] https://lists.debian.org/debian-qa/2013/07/msg00024.html


Reply to: