Bug 58855

Summary: About lang/ruby18's fileutils vs ruby-shim-ruby18's fileutils
Product: Ports & Packages Reporter: jfkimura
Component: Individual Port(s)Assignee: Akinori MUSHA <knu>
Status: Closed FIXED    
Severity: Affects Only Me CC: jfkimura
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description jfkimura 2003-11-03 03:40:17 UTC
	I am a user of ruby.
	There is a tool of fileutils.rb in lang/ruby18,
	but movement in lang/ruby16-shim-ruby18 seems to be different.
	I wanted to make it seem to be 'cp -Rp /home/fkimura /tmp'.

How-To-Repeat: 
sample script
---
#!/usr/bin/env ruby
require 'fileutils'
IN1 = "/home/fkimura"
module FileUtils16
  def FileUtils16.cp_r(src, dest, *options)
    begin
      FileUtils.cp_r(src, dest, *options)
    rescue TypeError
      optionhash = {}
      options.each { |o| optionhash[o] = true }
      FileUtils.cp_r(src, dest, optionhash)
    end
  end
end

FileUtils16.cp_r("#{IN1}/", "/tmp", :preserve)
exit 0
---

 - ruby1.6.8 + ruby-shim-ruby18 (using USE_RUBY_FEATURES=fileutils)
	It was carried out to think in this case.

 - ruby18
	A file is copied after directory of fkimura was made under /tmp in this case.
	Cannot you unify it?
Comment 1 Kirill Ponomarev freebsd_committer freebsd_triage 2003-11-03 07:19:42 UTC
Responsible Changed
From-To: freebsd-ports-bugs->knu

Over to maintainer
Comment 2 jfkimura 2003-11-10 03:46:33 UTC
I took an answer by knu san directly and was able to understand.
This PR hopes to be already close

tks

---
Fumihiko Kimura <jfkimura@yahoo.co.jp>

__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/
Comment 3 Akinori MUSHA freebsd_committer freebsd_triage 2003-11-10 06:02:23 UTC
State Changed
From-To: open->closed

The difference is in File.basename() and I don't feel like 
patching shim's fileutils.rb but I'd rather encourage script 
writers to make their scripts follow the 1.8 behaviour. 

The submitter kindly agreed.  Thanks!