distro-build: refine client--server split
original commit: df857e1c76d6420684446ac92555ef709c673c8d
This commit is contained in:
parent
9b579f598d
commit
37b51c6b7b
|
@ -1,57 +1,49 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require racket/cmdline
|
(require racket/cmdline
|
||||||
racket/file
|
racket/file
|
||||||
racket/path
|
racket/path)
|
||||||
(only-in "config.rkt" extract-options)
|
|
||||||
"url-options.rkt")
|
(provide set-config)
|
||||||
|
|
||||||
(module test racket/base)
|
(module test racket/base)
|
||||||
|
|
||||||
(define-values (dest-config-file config-file config-mode
|
(module+ main
|
||||||
install-name build-stamp
|
|
||||||
default-doc-search default-catalogs)
|
|
||||||
(command-line
|
(command-line
|
||||||
#:args
|
#:args
|
||||||
(dest-config-file config-file config-mode
|
(dest-config-file install-name build-stamp
|
||||||
install-name build-stamp
|
|
||||||
doc-search . catalog)
|
doc-search . catalog)
|
||||||
(values dest-config-file config-file config-mode
|
(set-config dest-config-file
|
||||||
install-name build-stamp
|
install-name build-stamp
|
||||||
doc-search catalog)))
|
doc-search catalog)))
|
||||||
|
|
||||||
(define config (if (equal? config-file "")
|
(define (set-config dest-config-file
|
||||||
(hash)
|
install-name build-stamp
|
||||||
(extract-options config-file config-mode)))
|
doc-search catalogs)
|
||||||
|
(define orig
|
||||||
|
(if (file-exists? dest-config-file)
|
||||||
|
(call-with-input-file* dest-config-file read)
|
||||||
|
(hash)))
|
||||||
|
|
||||||
(define doc-search (choose-doc-search config default-doc-search))
|
(let* ([table orig]
|
||||||
|
[table
|
||||||
(define catalogs (choose-catalogs config default-catalogs))
|
(if (equal? doc-search "")
|
||||||
|
table
|
||||||
(define orig
|
(hash-set table 'doc-search-url doc-search))]
|
||||||
(if (file-exists? dest-config-file)
|
[table (if (equal? catalogs '(""))
|
||||||
(call-with-input-file* dest-config-file read)
|
table
|
||||||
(hash)))
|
(hash-set table 'catalogs
|
||||||
|
(for/list ([c (in-list catalogs)])
|
||||||
(let* ([table orig]
|
(if (equal? c "")
|
||||||
[table
|
#f
|
||||||
(if (equal? doc-search "")
|
c))))]
|
||||||
table
|
[table (if (equal? install-name "")
|
||||||
(hash-set table 'doc-search-url doc-search))]
|
table
|
||||||
[table (if (equal? catalogs '(""))
|
(hash-set table 'installation-name install-name))]
|
||||||
table
|
[table (hash-set table 'build-stamp build-stamp)])
|
||||||
(hash-set table 'catalogs
|
(unless (equal? table orig)
|
||||||
(for/list ([c (in-list catalogs)])
|
(make-directory* (path-only dest-config-file))
|
||||||
(if (equal? c "")
|
(call-with-output-file dest-config-file
|
||||||
#f
|
#:exists 'truncate
|
||||||
c))))]
|
(lambda (o)
|
||||||
[table (if (equal? install-name "")
|
(write table o)
|
||||||
table
|
(newline o))))))
|
||||||
(hash-set table 'installation-name install-name))]
|
|
||||||
[table (hash-set table 'build-stamp build-stamp)])
|
|
||||||
(unless (equal? table orig)
|
|
||||||
(make-directory* (path-only dest-config-file))
|
|
||||||
(call-with-output-file dest-config-file
|
|
||||||
#:exists 'truncate
|
|
||||||
(lambda (o)
|
|
||||||
(write table o)
|
|
||||||
(newline o)))))
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
racket/system
|
racket/system
|
||||||
compiler/find-exe
|
compiler/find-exe
|
||||||
(only-in "config.rkt" extract-options)
|
(only-in "config.rkt" extract-options)
|
||||||
"display-time.rkt")
|
distro-build/display-time)
|
||||||
|
|
||||||
(module test racket/base)
|
(module test racket/base)
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#lang racket/base
|
||||||
|
(require racket/cmdline
|
||||||
|
racket/file
|
||||||
|
racket/path
|
||||||
|
(only-in "config.rkt" extract-options)
|
||||||
|
"url-options.rkt"
|
||||||
|
distro-build/set-config)
|
||||||
|
|
||||||
|
(module test racket/base)
|
||||||
|
|
||||||
|
(define-values (dest-config-file config-file config-mode
|
||||||
|
install-name build-stamp
|
||||||
|
default-doc-search default-catalogs)
|
||||||
|
(command-line
|
||||||
|
#:args
|
||||||
|
(dest-config-file config-file config-mode
|
||||||
|
install-name build-stamp
|
||||||
|
doc-search . catalog)
|
||||||
|
(values dest-config-file config-file config-mode
|
||||||
|
install-name build-stamp
|
||||||
|
doc-search catalog)))
|
||||||
|
|
||||||
|
(define config (if (equal? config-file "")
|
||||||
|
(hash)
|
||||||
|
(extract-options config-file config-mode)))
|
||||||
|
|
||||||
|
(define doc-search (choose-doc-search config default-doc-search))
|
||||||
|
|
||||||
|
(define catalogs (choose-catalogs config default-catalogs))
|
||||||
|
|
||||||
|
(set-config dest-config-file
|
||||||
|
install-name build-stamp
|
||||||
|
doc-search catalogs)
|
Loading…
Reference in New Issue
Block a user