Fix to kde-common/admin/detect-autoconf.pl [PATCH]

Michael Pyne michael.pyne at kdemail.net
Wed Oct 10 01:06:18 BST 2007


Anyone care to review and/or commit this change to admin/detect-autoconf.pl (I 
can't commit because I don't have permissions and either way this needs 
reviewed).

I was notified that the version sorting logic in detect-autoconf.pl is wrong.  
It will prefer e.g. automake-1.4 to automake-1.10.  The attached patch fixes 
that issue (along with some minor whitespace changes).

It does so by adding more logic to the version comparisons.  The compare 
function will separate out version components, make their sizes match by 
prepending zeroes to the digits until the digit lengths match and then do the 
normal lexicographic comparison. (i.e. 1.4 < 1.10 by internally comparing 
1.04 and 1.10).  2.52 and 2.53a would still show 2.53a being greater (without 
making 2.52 into 2.052).

A program with no version number is still preferred to one with a specific 
version.  Normally this is a symlink to a wrapper script that should 
intelligently choose the correct auto* program to run but on Debian and its 
derivatives it is a symlink to a specific version of the program.

The bug where detect-autoconf.pl would prefer autofoo-wrapper.sh should remain 
fixed as well (although I changed the check to be more general).

Regards,
 - Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-detect-autoconf-version-sorting.patch
Type: text/x-diff
Size: 5011 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071009/c288edd5/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071009/c288edd5/attachment.sig>


More information about the kde-core-devel mailing list