From 6b54693398c22f657f5d6c924164e1b1144aaeaa Mon Sep 17 00:00:00 2001 From: Ingy dot Net Date: Wed, 7 Apr 2010 23:59:00 -0700 Subject: [PATCH] Patched rakudo to look for .pm6 modules. Per the plan devised by Larry and Jonathan. Signed-off-by: Moritz Lenz --- src/Perl6/Module/Locator.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Perl6/Module/Locator.pm b/src/Perl6/Module/Locator.pm index 94a3b506a2f..4757f25809d 100644 --- a/src/Perl6/Module/Locator.pm +++ b/src/Perl6/Module/Locator.pm @@ -18,14 +18,20 @@ method find_candidates($lookfor, @inc) { my $check_path := pir::substr__SSII($path, 0, pir::length__IS($path) - 1); if pir::stat__ISI($check_path, 0) && pir::stat__ISI($check_path, 2) { my @dir := pir::new__PS('OS').readdir($path); + my $candidate := ""; for @dir { # pir::say(" readdir: $_"); - if pir::substr__SSII($_, 0, pir::length__IS($file) + 1) eq $file ~ '.' && - pir::substr__SSII($_, pir::length__IS($_) - 3, 3) eq '.pm' { - @candidates.push("$path$_"); - # pir::say(" found: $path$_"); + if pir::substr__SSII($_, 0, pir::length__IS($file) + 1) eq $file ~ '.' { + if pir::substr__SSII($_, pir::length__IS($_) - 4, 4) eq '.pm6' || + !$candidate && pir::substr__SSII($_, pir::length__IS($_) - 3, 3) eq '.pm' { + $candidate := "$path$_"; + } } } + if $candidate { + @candidates.push($candidate); + # pir::say(" found: $candidate"); + } } } return @candidates;