- Timestamp:
- 12/11/05 03:56:59 (3 years ago)
- Files:
-
- 1 modified
-
inc/Module/Install/Pugs.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
inc/Module/Install/Pugs.pm
r8170 r8171 192 192 if (-d $ghc_root) { 193 193 # Looks like we've found a GHC directory. Find the latest 194 # ghc inside that. Sorted from lexically highest to lowest. 195 196 # XXX - This will bite us should GHC contain a two-digit 197 # revision. Eg, 6.9.0 vs 6.10.0 198 199 my @ghc_choices = reverse glob(qq{$ghc_root/ghc-*}); 194 # ghc inside that. Sort versions from highest to lowest. 195 196 my @ghc_choices = sort { 197 _normalize_version($b) cmp _normalize_version($a) 198 } glob(qq{$ghc_root/ghc-*}); 200 199 201 200 GHC_TEST: … … 245 244 } 246 245 246 sub _normalize_version { 247 my $dir = shift; 248 $dir =~ /.*ghc-(.*)$/i or die "Invalid version: $dir"; 249 my $ver = $1; 250 $ver =~ s{(\d+)}{sprintf('%09s', $1)}eg; 251 return $ver; 252 } 253 247 254 =head2 assert_ghc_pkg 248 255
