openbsd-ports/lang/rubinius/patches/patch-lib_fileutils_rb
2011-01-06 20:20:01 +00:00

27 lines
989 B
Plaintext

$OpenBSD: patch-lib_fileutils_rb,v 1.2 2011/01/06 20:20:01 jeremy Exp $
Make FileUtils.mkdir_p act more like mkdir(1) -p, by not attempting
to create directories that already exist. This fixes systrace
warnings when building ports.
--- lib/fileutils.rb.orig Tue Dec 21 11:30:57 2010
+++ lib/fileutils.rb Thu Jan 6 09:31:43 2011
@@ -201,7 +201,7 @@ module FileUtils
list.map {|path| path.sub(%r</\z>, '') }.each do |path|
# optimize for the most common case
begin
- fu_mkdir path, options[:mode]
+ fu_mkdir path, options[:mode] unless File.directory?(path)
next
rescue SystemCallError
next if File.directory?(path)
@@ -214,7 +214,7 @@ module FileUtils
end
stack.reverse_each do |path|
begin
- fu_mkdir path, options[:mode]
+ fu_mkdir path, options[:mode] unless File.directory?(path)
rescue SystemCallError => err
raise(err) unless File.directory?(path)
end