Fix "raco distribute". Patch from upstream.
This commit is contained in:
parent
fe4fa117d8
commit
60d7342c07
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.9 2016/01/13 02:05:21 juanfra Exp $
|
||||
# $OpenBSD: Makefile,v 1.10 2016/01/14 21:21:01 juanfra Exp $
|
||||
|
||||
PORTROACH_COMMENT = hide pre-release versions (e.g. 6.1.90.900)
|
||||
PORTROACH = limit:!.*\.[0-9][0-9][0-9]-src-builtpkgs$$
|
||||
@ -15,7 +15,7 @@ ONLY_FOR_ARCHS = amd64 i386 powerpc sparc64
|
||||
COMMENT = multi-paradigm programming language
|
||||
|
||||
V = 6.3
|
||||
REVISION = 3
|
||||
REVISION = 4
|
||||
PKGNAME = racket-minimal-$V
|
||||
DISTFILES = racket-minimal-$V-src-builtpkgs${EXTRACT_SUFX} \
|
||||
racket-openbsd-1${EXTRACT_SUFX}
|
||||
|
@ -0,0 +1,39 @@
|
||||
$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))))))
|
||||
|
@ -1,13 +1,37 @@
|
||||
$OpenBSD: patch-collects_compiler_embed_rkt,v 1.1 2016/01/13 02:05:21 juanfra Exp $
|
||||
$OpenBSD: patch-collects_compiler_embed_rkt,v 1.2 2016/01/14 21:21:01 juanfra Exp $
|
||||
|
||||
"raco distribute" only works correctly when "raco exe" generates
|
||||
files with the write permission enabled.
|
||||
http://bugs.racket-lang.org/query/?cmd=view&pr=15214
|
||||
|
||||
--- collects/compiler/embed.rkt.orig Tue Jan 12 03:24:07 2016
|
||||
+++ collects/compiler/embed.rkt Tue Jan 12 03:47:11 2016
|
||||
@@ -1820,4 +1820,4 @@
|
||||
;; Restores old permissions (if not #f)
|
||||
(define (done-writable dest-exe old-perms)
|
||||
(when old-perms
|
||||
https://github.com/racket/racket/commit/9498bdd
|
||||
|
||||
--- collects/compiler/embed.rkt.orig Fri Oct 16 23:00:55 2015
|
||||
+++ collects/compiler/embed.rkt Thu Jan 14 21:41:32 2016
|
||||
@@ -21,6 +21,7 @@
|
||||
"private/pe-rsrc.rkt"
|
||||
"private/collects-path.rkt"
|
||||
"private/configdir.rkt"
|
||||
+ "private/write-perm.rkt"
|
||||
"find-exe.rkt")
|
||||
|
||||
|
||||
@@ -1782,20 +1783,3 @@
|
||||
[(list? p) (map mac-mred-collects-path-adjust p)]
|
||||
[(relative-path? p) (build-path 'up 'up 'up p)]
|
||||
[else p]))
|
||||
-
|
||||
-;; Returns #f (no change needed) or old permissions
|
||||
-(define (ensure-writable dest-exe)
|
||||
- (cond
|
||||
- [(member 'write (file-or-directory-permissions dest-exe))
|
||||
- ;; No change needed
|
||||
- #f]
|
||||
- [else
|
||||
- (define old-perms
|
||||
- (file-or-directory-permissions dest-exe 'bits))
|
||||
- (file-or-directory-permissions dest-exe (bitwise-ior old-perms #o200))
|
||||
- old-perms]))
|
||||
-
|
||||
-;; Restores old permissions (if not #f)
|
||||
-(define (done-writable dest-exe old-perms)
|
||||
- (when old-perms
|
||||
- (file-or-directory-permissions dest-exe old-perms)))
|
||||
+ (file-or-directory-permissions dest-exe #o755)))
|
||||
|
@ -0,0 +1,30 @@
|
||||
$OpenBSD: patch-collects_compiler_private_write-perm_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/private/write-perm.rkt.orig Thu Jan 14 21:41:32 2016
|
||||
+++ collects/compiler/private/write-perm.rkt Thu Jan 14 21:41:32 2016
|
||||
@@ -0,0 +1,21 @@
|
||||
+#lang racket/base
|
||||
+
|
||||
+(provide ensure-writable
|
||||
+ done-writable)
|
||||
+
|
||||
+;; Returns #f (no change needed) or old permissions
|
||||
+(define (ensure-writable dest-exe)
|
||||
+ (cond
|
||||
+ [(member 'write (file-or-directory-permissions dest-exe))
|
||||
+ ;; No change needed
|
||||
+ #f]
|
||||
+ [else
|
||||
+ (define old-perms
|
||||
+ (file-or-directory-permissions dest-exe 'bits))
|
||||
+ (file-or-directory-permissions dest-exe (bitwise-ior old-perms #o200))
|
||||
+ old-perms]))
|
||||
+
|
||||
+;; Restores old permissions (if not #f)
|
||||
+(define (done-writable dest-exe old-perms)
|
||||
+ (when old-perms
|
||||
+ (file-or-directory-permissions dest-exe old-perms)))
|
Loading…
Reference in New Issue
Block a user