Did i just made the fastest dependency checker in the world? (198 packages in 1.5 seconds)

Toshio Kuratomi a.badger at gmail.com
Tue Apr 10 20:22:54 UTC 2007


On Tue, 2007-04-10 at 22:01 +0200, Mark wrote:
> so.. is mysql yust removing out those first 2 zero`s?... i`m having a
> hard time believing that..
> oke.. i wrote a tiny php script to make this clear:
> 
> <?php
> 
>     if (5.6 < 5.00504)
>     {
>         echo 'not what i would have expected<br />'; 
>     }
>     else
>     {
>         echo 'see, 5.00504 is smaller than 5.6 like i said<br />';
>     }
> 
>     if (1.1 == 1.01)
>     {
>         echo 'not what i would have expected<br />'; 
>     }
>     else
>     {
>         echo 'see, they 1.1 is not equal to 1.01<br />';
>     }
> 
> ?>
> 
> the result on my php (5.2.1) is: "see, 5.00504 is smaller than 5.6
> like i said" and "see, they 1.1 is not equal to 1.01"
> those are the facts that are gonna be used in the dep checker. though
> i will probably need to break the recursive loop quite a few time if
> those strange version numbers like 1.1b2 occur... 
> so jesse... how is your math going? ;)
> 

Mark, what people are trying to point out to you is that it doesn't
matter what php, mysql, you, jesse, or I think is a more recent version.
All that matters is what rpm thinks is a more recent version since rpm
is what will ultimately be managing the packages on the system.

Your two tests illustrate this problem.  The tests show that php has one
idea of what version is larger which will disagree with what rpm finds.
Therefore it will be returning wrong values.

-Toshio

PS: Your tests aren't accurately testing what php will need to check
either.  Your tests are using php floating point types but versions
(even without throwing rpm into the mix) aren't simple numbers.  2.10.1
vs 2.10.2 for instance.  And when you can compare those properly, try
comparing 2.10.1 vs 2.10.02.  And when you can compare those try
comparing 2.10.1beta1 vs 2.10.1... ad nauseum.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20070410/a1ddf00e/attachment-0002.bin 


More information about the devel mailing list