$OpenBSD: patch-collects_compiler_distribute_rkt,v 1.1 2016/01/14 21:21:01 juanfra Exp $

http://bugs.racket-lang.org/query/?cmd=view&pr=15214

https://github.com/racket/racket/commit/9498bdd

--- collects/compiler/distribute.rkt.orig	Fri Oct 16 23:00:55 2015
+++ collects/compiler/distribute.rkt	Thu Jan 14 21:41:32 2016
@@ -11,7 +11,8 @@
            "private/macfw.rkt"
            "private/windlldir.rkt"
            "private/elf.rkt"
-           "private/collects-path.rkt")
+           "private/collects-path.rkt"
+           "private/write-perm.rkt")
 
   (provide assemble-distribution)
 
@@ -59,6 +60,10 @@
 		 orig-binaries
 		 sub-dirs
 		 types)]
+           [old-permss (and executables?
+                            (eq? (system-type) 'unix)
+                            (for/list ([b (in-list binaries)])
+                              (ensure-writable b)))]
 	   [single-mac-app? (and executables?
                                  (eq? 'macosx (cross-system-type))
 				 (= 1 (length types))
@@ -151,6 +156,9 @@
                                                    exts-dir 
                                                    relative-exts-dir
                                                    relative->binary-relative)
+            ;; Restore executable permissions:
+            (when old-permss
+              (map done-writable binaries old-permss))
             ;; Done!
             (void))))))
 
