hi gabor,

On Fri, May 22, 2009 at 04:09:53PM +0200, Gabor Kiss wrote:
> $ find
> ..
> ../upgrade
> ../upgrade/mysql
> ../upgrade/mysql/2
> ../upgrade/mysql/2/T
> ../upgrade/mysql/2/E
> ../upgrade/mysql/3
> ../upgrade/mysql/3/D.sql
> ../upgrade/mysql/1
> ../upgrade/mysql/1/B.sql
> ../upgrade-dbadmin
> ../upgrade-dbadmin/mysql
> ../upgrade-dbadmin/mysql/2
> ../upgrade-dbadmin/mysql/2/A

<snip>

> However we need not filenames but version numbers as arguments
> of "dpkg --compare-versions", i.e. 1 2 3 in this example.

my memory is a bit vague here as it's been a while since i've looked at this
code.  however, i believe that <VERSION> isn't meant to be a subdirectory,
so instead T and E, for example, should be concatenated into a single file "2".

> Unfortunately the package versions are not single integers so sorting
> them is not a trivial problem:

<snip>

> So what about a little more complex package versions like 5.0.51a-24+lenny1 ?

this might still be a problem, but there's a simple workaround: cheat :)  i.e.
there's not a strict requirement that you have a exact mapping of versions,
so you could make a fake <VERSION> that sorted correctly.

> So I'm afraid this part of postinst script should be totally rewritten.

i'm not sure about "totally", but having proper sorting would be nice.  i think
calling dpkg --compareversions O(n^2) (n! if you want to be picky) is less than 
ideal though.

hm... i wonder how hard it'd be to write a bubble sort in /bin/sh...


        sean

Attachment: signature.asc
Description: Digital signature

Reply via email to