develooper Front page | perl.perl5.porters | Postings from July 2009

[perl #67628] [PATCH] Configure should sort inc_version_list

Thread Next
From:
Andy Dougherty
Date:
July 16, 2009 22:46
Subject:
[perl #67628] [PATCH] Configure should sort inc_version_list
Message ID:
rt-3.6.HEAD-2466-1247777558-1418.67628-75-0@perl.org
# New Ticket Created by  Andy Dougherty 
# Please include the string:  [perl #67628]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=67628 >


In searching for previous versions of perl, Configure
forgets to sort the directories according to version number,
so 5.10 sorts later than 5.8.

Specifically, without this patch, you'd get something like:

    inc_version_list='5.8.9 5.8.8 5.10.0/i686-linux 5.10.0'

i.e. 5.10.0 would be searched *after* 5.8.8.

With this patch, you get something like:

    inc_version_list='5.10.0/i686-linux 5.10.0 5.8.9 5.8.8'

I'd appreciate someone else trying this to double-check me.

--- perl-current/Configure	2009-07-03 13:23:43.000000000 -0400
+++ perl-andy/Configure	2009-07-16 16:43:06.553763294 -0400
@@ -6529,6 +6529,7 @@
     chdir($stem);
     ;@candidates = map {
 	[ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
+    ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
 }
 else {
     ;@candidates = ();

-- 
    Andy Dougherty		doughera@lafayette.edu


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About