From a28b98e831aad331d9e9e472000d572ae0f10e99 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 30 Sep 2009 10:46:05 +0100 Subject: Refactor the code for determining where an extension is on disk. --- make_ext.pl | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'make_ext.pl') diff --git a/make_ext.pl b/make_ext.pl index 7734bf585a..56af041867 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; } -- cgit v1.2.1