From: Nicholas Clark Date: Wed, 4 Feb 2009 12:15:19 +0000 (+0000) Subject: Clearer variable names. Add a mode line coda. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3380c781dc67e9bba70bd5913c7f0f3aa2274bf3;p=p5sagit%2Fp5-mst-13.2.git Clearer variable names. Add a mode line coda. Because a substantial amount of this file is about to be refactored, I decided that we should expand tabs to spaces. --- diff --git a/win32/FindExt.pm b/win32/FindExt.pm index 69efa0a..d122f30 100644 --- a/win32/FindExt.pm +++ b/win32/FindExt.pm @@ -71,23 +71,24 @@ sub is_static # NOTE: recursion limit of 10 to prevent runaway in case of symlink madness sub find_ext { + my $ext_dir = shift; my $prefix = shift; - my $dir = shift; - opendir my $dh, "$prefix$dir"; - while (defined (my $xxx = readdir $dh)) { - next if $xxx =~ /^\.\.?$/; - if ($xxx ne "DynaLoader") { - if (-f "$prefix$dir$xxx/$xxx.xs" || -f "$prefix$dir$xxx/$xxx.c" ) { - $ext{"$dir$xxx"} = $static{"$dir$xxx"} ? 'static' : 'dynamic'; - } elsif (-f "$prefix$dir$xxx/Makefile.PL") { - $ext{"$dir$xxx"} = 'nonxs'; - } else { - if (-d "$prefix$dir$xxx" && $dir =~ tr#/## < 10) { - find_ext($prefix, "$dir$xxx/"); - } + opendir my $dh, "$ext_dir$prefix"; + while (defined (my $item = readdir $dh)) { + next if $item =~ /^\.\.?$/; + next if $item eq "DynaLoader"; + my $this_ext = "$prefix$item"; + if (-f "$ext_dir$this_ext/$item.xs" || -f "$ext_dir$this_ext/$item.c" ) { + $ext{$this_ext} = $static{$this_ext} ? 'static' : 'dynamic'; + } elsif (-f "$ext_dir$this_ext/Makefile.PL") { + $ext{$this_ext} = 'nonxs'; + } else { + # It's not actually an extension. So recurse into it. + if (-d "$ext_dir$this_ext" && $prefix =~ tr#/## < 10) { + find_ext($ext_dir, "$this_ext/"); } - $ext{"$dir$xxx"} = 'known' if $ext{"$dir$xxx"} && $xxx =~ $no; } + $ext{$this_ext} = 'known' if $ext{$this_ext} && $item =~ $no; } # Special case: Add in modules that nest beyond the first level. @@ -96,12 +97,18 @@ sub find_ext # recursive finding breaks SDBM_File/sdbm). # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash) - if (!$dir && -d "${prefix}threads/shared") { + if (!$prefix && -d "${ext_dir}threads/shared") { $ext{"threads/shared"} = 'dynamic'; } - if (!$dir && -d "${prefix}Hash/Util/FieldHash") { + if (!$prefix && -d "${ext_dir}Hash/Util/FieldHash") { $ext{"Hash/Util/FieldHash"} = 'dynamic'; } } 1; +# Local variables: +# cperl-indent-level: 4 +# indent-tabs-mode: nil +# End: +# +# ex: set ts=8 sts=4 sw=4 et: