distro-build: support installation-name configuration for installers

The default is "snapshot" for non-release builds, left as the
version number for release builds.

original commit: 7e6838b0af04c01411dc52ef1011b3f9662b3f8e
This commit is contained in:
Matthew Flatt 2013-07-26 07:59:48 -06:00
parent a43341b710
commit 47017cb8c7
5 changed files with 39 additions and 5 deletions

View File

@ -120,6 +120,7 @@
[(#:dist-suffix) (simple-string? val)]
[(#:dist-catalogs) (and (list? val) (andmap string? val))]
[(#:dist-base-url) (string? val)]
[(#:install-name) (string? val)]
[(#:max-vm) (real? val)]
[(#:server) (simple-string? val)]
[(#:host) (simple-string? val)]

View File

@ -141,6 +141,11 @@ Site-configuration keywords (where <string*> means no spaces, etc.):
present) extended with "doc/local-redirect/index.html", or the
`DOC_SEARCH' makefile variable
#:install-name <string> --- string used as the name of the
installation for package operations in the `user' package scope,
where "" keeps the name as the Racket version; the default is
"snapshot" if the value of `#:release?' is false, "" otherwise.
#:dist-name <string> --- the distribution name; defaults to the
`DIST_NAME' makefile variable

View File

@ -21,6 +21,8 @@
(define default-release? #f)
(define default-clean? #f)
(define snapshot-install-name "snapshot")
(define-values (config-file config-mode
default-server default-pkgs default-doc-search
default-dist-name default-dist-base default-dist-dir)
@ -252,6 +254,9 @@
(define source? (get-opt c '#:source? #f))
(define source-pkgs? (get-opt c '#:source-pkgs? source?))
(define source-runtime? (get-opt c '#:source-runtime? source?))
(define install-name (get-opt c '#:install-name (if release?
""
snapshot-install-name)))
(~a " SERVER=" server
" PKGS=" (q pkgs)
" DOC_SEARCH=" (q doc-search)
@ -261,6 +266,7 @@
" DIST_DIR=" dist-dir
" DIST_SUFFIX=" (q dist-suffix)
" DIST_CATALOGS_q=" (qq dist-catalogs kind)
" INSTALL_NAME=" (q install-name)
" RELEASE_MODE=" (if release? "--release" (q ""))
" SOURCE_MODE=" (if source-runtime? "--source" (q ""))
" PKG_SOURCE_MODE=" (if source-pkgs?
@ -334,7 +340,10 @@
rdme
(rdme (add-defaults c
'#:release? default-release?
'#:pkgs (string-split default-pkgs))))))
'#:pkgs (string-split default-pkgs)
'#:install-name (if (get-opt c '#:release? default-release?)
""
snapshot-install-name))))))
(make-directory* (build-path "build" "readmes"))
(define readme (make-temporary-file
"README-~a"

View File

@ -48,6 +48,18 @@
@(apply ~a (for/list ([catalog (in-list catalogs)])
@~a{@"\n" @|catalog|}))
@|is| consulted, first.@"\n"}))@;
@(let* ([name (hash-ref config '#:install-name "")])
(if (or (equal? name "")
(equal? name (version)))
""
@~a{@"\n"The distribution has been configured so that the installation
name is
@name
Multiple installations with this name share `user'-scoped packages,
which makes it easier to upgrade from such an installation to this one.
To avoid sharing (which is better for keeping multiple installations
active) use `raco pkg config --set name' to choose a different name
for this installation.@"\n"}))@;
Visit
http://racket-lang.org/

View File

@ -5,11 +5,15 @@
(only-in "config.rkt" extract-options)
"url-options.rkt")
(define-values (dest-config-file config-file config-mode default-doc-search default-catalogs)
(define-values (dest-config-file config-file config-mode
install-name
default-doc-search default-catalogs)
(command-line
#:args
(dest-config-file config-file config-mode doc-search . catalog)
(values dest-config-file config-file config-mode doc-search catalog)))
(dest-config-file config-file config-mode install-name doc-search . catalog)
(values dest-config-file config-file config-mode
install-name
doc-search catalog)))
(define config (if (equal? config-file "")
(hash)
@ -35,7 +39,10 @@
(for/list ([c (in-list catalogs)])
(if (equal? c "")
#f
c))))])
c))))]
[table (if (equal? install-name "")
table
(hash-set table 'installation-name install-name))])
(unless (equal? table orig)
(make-directory* (path-only dest-config-file))
(call-with-output-file dest-config-file