make the winvers tweaker use and modify files with the new names
This commit is contained in:
parent
296818e11f
commit
c12874661f
|
@ -5,8 +5,8 @@
|
|||
;; "xxxxxxx" in their name by a "NNN_NNN" version number, and will also do this
|
||||
;; rewrite in all files. (Actually looking for a few known string templates,
|
||||
;; to be safe.) Note that this is done *in-place*, so it will not work from a
|
||||
;; running MzScheme.exe on Windows -- "winvers.ss" uses a trick of making a
|
||||
;; copy of the binary and restarting that copy for the actual change.
|
||||
;; running Racket.exe on Windows -- "winvers.ss" uses a trick of making a copy
|
||||
;; of the binary and restarting that copy for the actual change.
|
||||
|
||||
#lang scheme/base
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
|||
(define binary-extensions '("exe" "dll" "lib" "so" "def" "exp" #|"obj" "o"|#))
|
||||
(define xxxs #"xxxxxxx")
|
||||
(define xxxs-re
|
||||
(bytes-append #"(?:lib(?:mzsch|mzgc|mred)(?:|3m))(" xxxs #")"))
|
||||
(bytes-append #"(?:lib(?:g?racket|mzgc)(?:|3m))(" xxxs #")"))
|
||||
(define renaming (regexp (format "^~a[.](?:dll|lib|exp)$" xxxs-re)))
|
||||
(define substitutions
|
||||
(map (lambda (s) (byte-regexp (regexp-replace #rx#"~a" s xxxs-re)))
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
(let* ([tmpdir (find-system-path 'temp-dir)]
|
||||
[vers (build-path tmpdir "setvers")])
|
||||
(unless (directory-exists? vers) (make-directory vers))
|
||||
(for ([p (in-list '("mzscheme.exe" "lib"))])
|
||||
(for ([p (in-list '("racket.exe" "lib"))])
|
||||
(let ([dest (build-path vers p)])
|
||||
((cond [(file-exists? dest) delete-file]
|
||||
[(directory-exists? dest) delete-directory/files]
|
||||
[else void])
|
||||
dest)
|
||||
(copy-directory/files (build-path (find-console-bin-dir) p) dest)))
|
||||
(build-path vers "mzscheme.exe")))
|
||||
(build-path vers "racket.exe")))
|
||||
|
||||
(define (patch-files)
|
||||
(parameterize ([current-command-line-arguments
|
||||
|
@ -40,7 +40,7 @@
|
|||
(printf "re-launching last time...~n")
|
||||
(subprocess
|
||||
(current-output-port) (current-input-port) (current-error-port)
|
||||
(build-path (find-console-bin-dir) "mzscheme.exe")
|
||||
(build-path (find-console-bin-dir) "racket.exe")
|
||||
"-l" "setup/winvers" "finish")]
|
||||
[(equal? argv #("finish"))
|
||||
(sleep 1) ; time for other process to end
|
||||
|
|
Loading…
Reference in New Issue
Block a user