Changeset 27531

Show
Ignore:
Timestamp:
04.06.2013 11:11:39 (6 years ago)
Author:
jmt12
Message:

Only output the message about using copy instead of hard/soft link once

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/perllib/FileUtils.pm

    r27526 r27531  
    3939# Configuration 
    4040my $debug = 0; 
     41 
     42# Globals 
     43my $done_link_warning = 0; 
    4144 
    4245## @function _callFunction($driver_name, $function_name, ...) 
     
    554557  elsif ($src_driver ne 'LocalFS') 
    555558  { 
    556     &printWarning('Cannot symbolic link on non-local file systems - copying instead: ' . $src_file . ' => ' . $dst_file); 
     559    if (!$done_link_warning) 
     560    { 
     561      &printWarning('Cannot symbolic link on non-local file systems - copying all files instead'); 
     562      $done_link_warning = 1; 
     563    } 
    557564    &transferFiles($src_file, $dst_file, 'COPY'); 
    558565  } 
    559566  else 
    560567  { 
    561     &printWarning('Cannot symbolic link between file systems - copying instead: ' . $src_file . ' => ' . $dst_file); 
     568    if (!$done_link_warning) 
     569    { 
     570      &printWarning('Cannot symbolic link between file systems - copying all files instead'); 
     571      $done_link_warning = 1; 
     572    } 
    562573    &transferFiles($src_file, $dst_file, 'COPY'); 
    563574  } 
     
    585596  my $path = shift(@_); 
    586597  my $driver = &FileUtils::_determineDriver($path); 
    587   return &FileUtils::_callFunction($driver, 'isHDFS'); 
     598  my $result = &FileUtils::_callFunction($driver, 'isHDFS'); 
     599  ###rint STDERR "[DEBUG] FileUtils::isHDFS(" . $path . ") => " . $result . "\n"; 
     600  return $result; 
    588601} 
    589602## isHDFS() 
     
    763776  elsif ($src_driver ne 'LocalFS') 
    764777  { 
    765     &printWarning('Cannot symbolic link on non-local file systems - copying instead: ' . $src_file . ' => ' . $dst_file); 
     778    if (!$done_link_warning) 
     779    { 
     780      &printWarning('Cannot symbolic link on non-local file systems - copying all files instead'); 
     781      $done_link_warning = 1; 
     782    } 
    766783    &transferFiles($src_file, $dst_file, 'COPY'); 
    767784  } 
    768785  else 
    769786  { 
    770     &printWarning('Cannot symbolic link between file systems - copying instead: ' . $src_file . ' => ' . $dst_file); 
     787    if (!$done_link_warning) 
     788    { 
     789      &printWarning('Cannot symbolic link between file systems - copying all files instead'); 
     790      $done_link_warning = 1; 
     791    } 
    771792    &transferFiles($src_file, $dst_file, 'COPY'); 
    772793  }