Rakefiles: fixed `cp_rx()` extension to work with Ruby 2.5 stx-8.0.0
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 02 Apr 2018 07:32:49 +0100
branchstx-8.0.0
changeset 227 640f942d4e63
parent 226 67883ba3bd17
child 228 8566593080a5
child 232 85c422506875
Rakefiles: fixed `cp_rx()` extension to work with Ruby 2.5 ...which removed `fu_check_options()` from `FileUtils` in favor of new syntax.
rakelib/extensions.rb
--- a/rakelib/extensions.rb	Sun Apr 01 23:03:45 2018 +0100
+++ b/rakelib/extensions.rb	Mon Apr 02 07:32:49 2018 +0100
@@ -395,12 +395,12 @@
   # Taken from http://www.ruby-forum.com/attachment/4467/filteredCopy.rb  
   # Both of these are modified from the implementations in fileutils.rb from 
   # Ruby 1.9.1p378  
-  def cp_rx(src, dest, options = {}, &filter)
-    fu_check_options options, OPT_TABLE['cp_r']
-    fu_output_message "cp -r#{options[:preserve] ? 'p' : ''}#{options[:remove_destination] ? ' --remove-destination' : ''} #{[src, dest].flatten.join ' '}" if options[:verbose]
-    return if options[:noop]
+  def cp_rx(src, dest, preserve: nil, noop: nil, verbose: nil,
+         dereference_root: true, remove_destination: nil, &filter)        
+    fu_output_message "cp_rx -r#{preserve ? 'p' : ''}#{remove_destination ? ' --remove-destination' : ''} #{[src,dest].flatten.join ' '} " if verbose 
+    return if noop
     fu_each_src_dest(src, dest) do |s, d|
-      copy_entryx s, d, filter, options[:preserve], options[:dereference_root], options[:remove_destination]
+      copy_entryx s, d, filter, preserve, dereference_root, remove_destination
     end
   end
 
@@ -411,7 +411,7 @@
         destent = Entry_.new(dest, ent.rel, false)
         File.unlink destent.path if remove_destination && File.file?(destent.path)
         ent.copy destent.path
-        ent.copy_metadata destent.path if preserve
+        ent.copy_metadata destent.path if nil
       end
     end
   end