summaryrefslogtreecommitdiff
path: root/make_ext.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-09-30 10:46:05 +0100
committerNicholas Clark <nick@ccl4.org>2009-09-30 10:46:05 +0100
commita28b98e831aad331d9e9e472000d572ae0f10e99 (patch)
treec00524550ade5290bf4ac616ecfb9191815fd32b /make_ext.pl
parent2be4b1501bbd2d5f0976d80ba74e03d991a04375 (diff)
downloadperl-a28b98e831aad331d9e9e472000d572ae0f10e99.tar.gz
Refactor the code for determining where an extension is on disk.
Diffstat (limited to 'make_ext.pl')
-rw-r--r--make_ext.pl31
1 files changed, 15 insertions, 16 deletions
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;
}