[csw-maintainers] checkpkg: New feature: file collision detection

Peter FELECAN pfelecan at opencsw.org
Tue Dec 14 11:46:49 CET 2010


"Maciej (Matchek) Blizinski" <maciej at opencsw.org> writes:

> No dia 13 de Dezembro de 2010 15:48, Peter FELECAN
> <pfelecan at opencsw.org> escreveu:
>>> An alternate approach would be to use sqlobject's SQL representation
>>> generator - that would be much better.
>>
>> Probably. This is the issue with many abstraction mechanisms: when it
>> comes to optimization it's a dicey game.
>
> I think we could have another shot at implementing placeholder-SQL
> insertion, taking paramstyle into account.  It's not that easy,
> unfortunately.  Paramstyle is defined on the module level, and we only
> have the connection, which does not contain paramstyle information.
> Finding out the module based on connection is in theory possible using
> introspection[1], but the way to look it up depends on the
> implementation of a specific database module, and we're back at the
> original problem of writing database-independent code.

This is exactly what I call an unfinished job from the part of sqlobject
but maybe I'm too exigent and it's the price to pay for the abstraction.

> A quick-and-dirty approach would be: Since we don't know which
> paramstyle to use, we try one of them, and if it fails, we catch the
> exception and try again with another paramstyle.  If this fails too,
> we bail out.  I would hate this kind of implementation, but having
> this on one side, and impatient and angry Peter Felecan on the
> other... I'd choose ugly code and happy Peter.

Angry is not the word that I'd use to characterize my usual state of
mind. If we need to chose between beauty (ugly code) and good (happy
user) maybe we need to look for the truth: the code should not be
uglier than necessary to accomplish what we want... and what we want in
this case is to have a good collision detection in a reasonable time on
the build farm and outside the build farm.

-- 
Peter


More information about the maintainers mailing list