CPAN-Mini-Inject-REST

 view release on metacpan or  search on metacpan

inc/File/Copy/Recursive.pm  view on Meta::CPAN

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
   if( -l $_[0] && $CopyLink ) {
      carp "Copying a symlink ($_[0]) whose target does not exist"
          if !-e readlink($_[0]) && $BdTrgWrn;
      symlink readlink(shift()), shift() or return;
   } else
      copy(@_) or return;
 
      my @base_file = File::Spec->splitpath($_[0]);
      my $mode_trg = -d $_[1] ? File::Spec->catfile($_[1], $base_file[ $#base_file ]) : $_[1];
 
      chmod scalar((stat($_[0]))[2]), $mode_trg if $KeepMode;
   }
   return wantarray ? (1,0,0) : 1; # use 0's incase they do math on them and in case rcopy() is called in list context = no uninit val warnings
}
 
sub rcopy {
    if (-l $_[0] && $CopyLink) {
        goto &fcopy;   
    }
     
    goto &dircopy if -d $_[0] || substr( $_[0], ( 1 * -1), 1) eq '*';

inc/File/Copy/Recursive.pm  view on Meta::CPAN

211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
my $dirn    = 0;
 
my $recurs; #must be my()ed before sub {} since it calls itself
$recurs sub {
   my ($str,$end,$buf) = @_;
   $filen++ if $end eq $baseend;
   $dirn++ if $end eq $baseend;
    
   $DirPerms = oct($DirPerms) if substr($DirPerms,0,1) eq '0';
   mkdir($end,$DirPerms) or return if !-d $end;
   chmod scalar((stat($str))[2]), $end if $KeepMode;
   if($MaxDepth && $MaxDepth =~ m/^\d+$/ && $level >= $MaxDepth) {
      return ($filen,$dirn,$level) if wantarray;
      return $filen;
   }
   $level++;
 
    
   my @files;
   if ( $] < 5.006 ) {
       opendir(STR_DH, $str) or return;

inc/File/Copy/Recursive.pm  view on Meta::CPAN

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
          else {
              if($ok_todo_asper_condcopy->($org)) {
                  if($SkipFlop) {
                      fcopy($org,$new,$buf) or next if defined $buf;
                      fcopy($org,$new) or next if !defined $buf;                     
                  }
                  else {
                      fcopy($org,$new,$buf) or return if defined $buf;
                      fcopy($org,$new) or return if !defined $buf;
                  }
                  chmod scalar((stat($org))[2]), $new if $KeepMode;
                  $filen++;
              }
          }
      }
      1;
   };
 
   $recurs->($_zero, $_one, $_[2]) or return;
   return wantarray ? ($filen,$dirn,$level) : $filen;
}

inc/Module/Install.pm  view on Meta::CPAN

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# we shouldn't really depend on it. See RT #24194 for detail.
# (Also, this module only supports Perl 5.6 and above).
eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006;
 
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
        my $s = (stat($0))[9];
 
        # If the modification time is only slightly in the future,
        # sleep briefly to remove the problem.
        my $a = $s - time;
        if ( $a > 0 and $a < 5 ) { sleep 5 }
 
        # Too far in the future, throw an error.
        my $t = time;
        if ( $s > $t ) { die <<"END_DIE" }



( run in 0.349 second using v1.01-cache-2.11-cpan-2b0bae70ee8 )