From: Nicholas Clark Date: Wed, 30 Sep 2009 09:46:05 +0000 (+0100) Subject: Refactor the code for determining where an extension is on disk. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a28b98e831aad331d9e9e472000d572ae0f10e99;p=p5sagit%2Fp5-mst-13.2.git Refactor the code for determining where an extension is on disk. --- diff --git a/make_ext.pl b/make_ext.pl index 7734bf5..56af041 100644 --- a/make_ext.pl +++ b/make_ext.pl @@ -242,23 +242,22 @@ foreach my $spec (@extspec) { my $mname = $spec; $mname =~ s!/!::!g; my $ext_pathname; - if (-d "ext/$spec" - # Temporary hack to cope with smokers that are not clearing directories: - && $spec =~ m!/! - ) { - # Old style ext/Data/Dumper/ - $ext_pathname = "ext/$spec"; - } else { - # New style ext/Data-Dumper/ - my $copy = $spec; - $copy =~ tr!/!-!; - foreach my $dir (@ext_dirs) { - if (-d "$dir/$copy") { - $ext_pathname = "$dir/$copy"; - last; - } + + # Try new style ext/Data-Dumper/ first + my $copy = $spec; + $copy =~ tr!/!-!; + foreach my $dir (@ext_dirs) { + if (-d "$dir/$copy") { + $ext_pathname = "$dir/$copy"; + last; } - if (!defined $ext_pathname) { + } + + if (!defined $ext_pathname) { + if (-d "ext/$spec") { + # Old style ext/Data/Dumper/ + $ext_pathname = "ext/$spec"; + } else { warn "Can't find extension $spec in any of @ext_dirs"; next; }