$OpenBSD: patch-lib_fileutils_rb,v 1.1.1.1 2016/01/07 00:52:46 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 15 21:07:31 2015
+++ lib/fileutils.rb	Sat Dec 26 13:11:04 2015
@@ -211,7 +211,7 @@ module FileUtils
     list.map {|path| remove_trailing_slash(path)}.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)
@@ -224,7 +224,7 @@ module FileUtils
       end
       stack.reverse_each do |dir|
         begin
-          fu_mkdir dir, options[:mode]
+          fu_mkdir dir, options[:mode] unless File.directory?(dir)
         rescue SystemCallError
           raise unless File.directory?(dir)
         end
