X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FAutoSplit.pm;h=25e29c3a989f08047419d6e669343a736f1452cc;hb=9bf12eaf439552772b53d65e2dd335097dac1a84;hp=8640576cc72973ac109abf6c898c92ae4f893a68;hpb=4b19af017623bfa3bb72bb164598a517f586e0d3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/AutoSplit.pm b/lib/AutoSplit.pm index 8640576..25e29c3 100644 --- a/lib/AutoSplit.pm +++ b/lib/AutoSplit.pm @@ -11,7 +11,7 @@ use strict; our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $Verbose, $Keep, $Maxlen, $CheckForAutoloader, $CheckModTime); -$VERSION = "1.0305"; +$VERSION = "1.0306"; @ISA = qw(Exporter); @EXPORT = qw(&autosplit &autosplit_lib_modules); @EXPORT_OK = qw($Verbose $Keep $Maxlen $CheckForAutoloader $CheckModTime); @@ -54,7 +54,7 @@ $keep defaults to 0. The fourth argument, I<$check>, instructs C to check the module -currently being split to ensure that it does include a C +currently being split to ensure that it includes a C specification for the AutoLoader module, and skips the module if AutoLoader is not detected. $check defaults to 1. @@ -199,6 +199,8 @@ sub autosplit_lib_modules{ # private functions +my $self_mod_time = (stat __FILE__)[9]; + sub autosplit_file { my($filename, $autodir, $keep, $check_for_autoloader, $check_mod_time) = @_; @@ -261,14 +263,15 @@ sub autosplit_file { die "Package $def_package ($modpname.pm) does not ". "match filename $filename" unless ($filename =~ m/\Q$modpname.pm\E$/ or - ($^O eq 'dos') or ($^O eq 'MSWin32') or + ($^O eq 'dos') or ($^O eq 'MSWin32') or ($^O eq 'NetWare') or $Is_VMS && $filename =~ m/$modpname.pm/i); - my($al_idx_file) = "$autodir/$modpname/$IndexFile"; + my($al_idx_file) = catfile($autodir, $modpname, $IndexFile); if ($check_mod_time){ my($al_ts_time) = (stat("$al_idx_file"))[9] || 1; - if ($al_ts_time >= $pm_mod_time){ + if ($al_ts_time >= $pm_mod_time and + $al_ts_time >= $self_mod_time){ print "AutoSplit skipped ($al_idx_file newer than $filename)\n" if ($Verbose >= 2); return undef; # one undef, not a list @@ -279,8 +282,8 @@ sub autosplit_file { print "AutoSplitting $filename ($modnamedir)\n" if $Verbose; - unless (-d "$modnamedir"){ - mkpath("$modnamedir",0,0777); + unless (-d $modnamedir){ + mkpath($modnamedir,0,0777); } # We must try to deal with some SVR3 systems with a limit of 14 @@ -324,7 +327,7 @@ sub autosplit_file { my($lname, $sname) = ($subname, substr($subname,0,$maxflen-3)); $modpname = _modpname($this_package); my($modnamedir) = catfile($autodir, $modpname); - mkpath("$modnamedir",0,0777); + mkpath($modnamedir,0,0777); my($lpath) = catfile($modnamedir, "$lname.al"); my($spath) = catfile($modnamedir, "$sname.al"); my $path; @@ -338,13 +341,14 @@ sub autosplit_file { if ($Verbose>=1); } push(@outfiles, $path); + my $lineno = $fnr - @cache; print OUT <