$OpenBSD: patch-lib_fileutils_rb,v 1.2 2017/03/24 14:39:05 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	Sun Mar 12 11:01:40 2017
+++ lib/fileutils.rb	Wed Mar 22 08:33:15 2017
@@ -191,7 +191,7 @@ module FileUtils
     list.map {|path| remove_trailing_slash(path)}.each do |path|
       # optimize for the most common case
       begin
-        fu_mkdir path, mode
+        fu_mkdir path, mode unless File.directory?(path)
         next
       rescue SystemCallError
         next if File.directory?(path)
@@ -204,7 +204,7 @@ module FileUtils
       end
       stack.reverse_each do |dir|
         begin
-          fu_mkdir dir, mode
+          fu_mkdir dir, mode unless File.directory?(dir)
         rescue SystemCallError
           raise unless File.directory?(dir)
         end
