Setup patch to keep test version if test version installed

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jan 26 09:31:00 GMT 2015


Hi David,

On Jan 25 23:46, David Stacey wrote:
> On 25/01/15 17:20, Corinna Vinschen wrote:
> >Instead of always defaulting to the curr version, Setup now checks if
> >the installed version of a package is higher than the curr version of
> >the package.
> 
> This sounds like a great idea - providing that the logic to compare two
> version numbers is sufficiently clever. Looking at operator<() in
> package_version.cc, it appears as though this is performing simple string
> comparison on the version numbers. This would fail in a number of cases. A
> real example from setup.ini:
> 
>     package: at-spi2-atk
>     curr: 2.10.2-1
>     prev: 2.8.1-1
> 
> A simple string comparison would prefer prev over curr!
> 
> In your patch, maybe it could be better to call
> packageversion::compareVersions() rather than use operator<(). I'm not
> terribly familiar with the setup code, so please excuse me if I'm mistaken,
> got lost in the code, or am completely barking up the wrong tree.

No, no.  Thanks for noticing!  I was sure that the comparison operators
are comparing using compareVersions() under the hood so I didn't check.
How embarrassing.  Now I see that they only do a casecompare, as you said.

I'll fix that in my code and check it in.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20150126/2af226b1/attachment.sig>


More information about the Cygwin-apps mailing list