Author: kwilliams
Date: Wed Dec 27 20:09:28 2006
New Revision: 8477

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/lib/Module/Build/Base.pm

Log:
Use syscopy() on OS/2 in copy_if_modified()

Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Wed Dec 27 20:09:28 2006
@@ -1,5 +1,8 @@
 Revision history for Perl extension Module::Build.
 
+ - Use syscopy() on OS/2 in copy_if_modified() so we make sure to
+   overwrite any existing target file. [Ilya Zakharevich]
+
  - Removed seemingly silly '~~' test in t/tilde.t.
 
  - In our test-time utility library t/lib/MBTest.pm, we need to know

Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Wed Dec 27 20:09:28 2006
@@ -4046,7 +4046,14 @@
   File::Path::mkpath(File::Basename::dirname($to_path), 0, oct(777));
   
   $self->log_info("Copying $file -> $to_path\n") if $args{verbose};
-  File::Copy::copy($file, $to_path) or die "Can't copy('$file', '$to_path'): 
$!";
+  
+  if ($^O eq 'os2') {# copy will not overwrite; 0x1 = overwrite
+    chmod 0666, $to_path;
+    File::Copy::syscopy($file, $to_path, 0x1) or die "Can't copy('$file', 
'$to_path'): $!";
+  } else {
+    File::Copy::copy($file, $to_path) or die "Can't copy('$file', '$to_path'): 
$!";
+  }
+
   # mode is read-only + (executable if source is executable)
   my $mode = oct(444) | ( $self->is_executable($file) ? oct(111) : 0 );
   chmod( $mode, $to_path );

Reply via email to