openbsd-ports/lang/ruby/1.8/patches/patch-lib_fileutils_rb
jeremy 71ecdc8e96 Modify FileUtils.mkdir_p to behave more like mkdir(1) -p. Instead of
attempting to create all intermediate directories and rescuing failures,
don't attempt to create directories that already exist.  Fixes systrace
warnings when building ruby ports.

ok landry
2010-10-12 15:39:06 +00:00

27 lines
984 B
Plaintext

$OpenBSD: patch-lib_fileutils_rb,v 1.1 2010/10/12 15:39:06 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 Fri Oct 8 08:52:53 2010
+++ lib/fileutils.rb Fri Oct 8 08:58:40 2010
@@ -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 unless File.directory?(path)
end