$OpenBSD: patch-lib_fileutils_rb,v 1.1.1.1 2019/01/14 16:13: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.

Index: lib/fileutils.rb
--- lib/fileutils.rb.orig
+++ lib/fileutils.rb
@@ -200,7 +200,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)
@@ -214,7 +214,7 @@ module FileUtils
       stack.pop                 # root directory should exist
       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
