diff --git a/pkgs/racket-pkgs/racket-doc/scribblings/raco/setup.scrbl b/pkgs/racket-pkgs/racket-doc/scribblings/raco/setup.scrbl index 4941e115fb..fbb296992b 100644 --- a/pkgs/racket-pkgs/racket-doc/scribblings/raco/setup.scrbl +++ b/pkgs/racket-pkgs/racket-doc/scribblings/raco/setup.scrbl @@ -670,7 +670,7 @@ Optional @filepath{info.rkt} fields trigger additional actions by [#:tidy? tidy? any/c #f] [#:jobs jobs exact-nonnegative-integer? #f] [#:get-target-dir get-target-dir (or/c #f (-> path-string?)) #f]) - void?]{ + boolean?]{ Runs @exec{raco setup} with various options: @itemlist[ @@ -709,7 +709,11 @@ Runs @exec{raco setup} with various options: @item{@racket[get-target-dir] --- if not @racket[#f], treated as a value for @sigelem[setup-option^ current-target-directory-getter]} -]} +] + +The result is @racket[#t] if @exec{raco setup} completes without error, +@racket[#f] otherwise.} + @subsection{@exec{raco setup} Unit} diff --git a/racket/collects/pkg/main.rkt b/racket/collects/pkg/main.rkt index 5a0942d801..19416b63f2 100644 --- a/racket/collects/pkg/main.rkt +++ b/racket/collects/pkg/main.rkt @@ -13,21 +13,24 @@ (prefix-in setup: setup/setup) (for-syntax racket/base)) -(define (setup no-setup? setup-collects jobs) +(define (setup what no-setup? setup-collects jobs) (unless (or (eq? setup-collects 'skip) no-setup? (not (member (getenv "PLT_PKG_NOSETUP") '(#f "")))) (define installation? (eq? 'installation (current-pkg-scope))) - (setup:setup - #:make-user? (not installation?) - #:avoid-main? (not installation?) - #:collections (and setup-collects - (map (lambda (s) - (if (list? s) s (list s))) - setup-collects)) - #:tidy? #t - #:make-doc-index? #t - #:jobs jobs))) + (unless (setup:setup + #:make-user? (not installation?) + #:avoid-main? (not installation?) + #:collections (and setup-collects + (map (lambda (s) + (if (list? s) s (list s))) + setup-collects)) + #:tidy? #t + #:make-doc-index? #t + #:jobs jobs) + ((current-pkg-error) + "packages ~a, although setup reported errors" + what)))) (define ((pkg-error cmd) . args) (apply raise-user-error @@ -191,7 +194,7 @@ #:link-dirs? link-dirs? (for/list ([p (in-list sources)]) (pkg-desc p a-type* name checksum #f)))))) - (setup no-setup setup-collects jobs)))] + (setup "installed" no-setup setup-collects jobs)))] ;; ---------------------------------------- [update "Update packages" @@ -246,7 +249,7 @@ #:update-implies? (not ignore-implies) #:strip (or (and source 'source) (and binary 'binary)) #:link-dirs? link-dirs?)))) - (setup no-setup setup-collects jobs)))] + (setup "updated" no-setup setup-collects jobs)))] ;; ---------------------------------------- [remove "Remove packages" @@ -270,7 +273,7 @@ #:demote? demote #:auto? auto #:force? force))) - (setup no-setup setup-collects jobs)))] + (setup "removed" no-setup setup-collects jobs)))] ;; ---------------------------------------- [show "Show information about installed packages" @@ -345,7 +348,7 @@ #:ignore-checksums? ignore-checksums #:use-cache? (not no-cache) #:strip (or (and source 'source) (and binary 'binary)))))) - (setup no-setup setup-collects jobs)))] + (setup "migrated" no-setup setup-collects jobs)))] ;; ---------------------------------------- [create "Bundle package from a directory or installed package" diff --git a/racket/collects/racket/HISTORY.txt b/racket/collects/racket/HISTORY.txt index 07f7e520b6..abaccabd1f 100644 --- a/racket/collects/racket/HISTORY.txt +++ b/racket/collects/racket/HISTORY.txt @@ -2,6 +2,7 @@ Version 5.90.0.11 Added flrandom and unsafe-flrandom xml: added a #:insert-newlines? argument to write-xexpr racket/contract: added channel/c +setup/setup: changed setup to return a boolean Version 5.90.0.10 Changed serializable-struct, etc. to provide deserialized-info:... diff --git a/racket/collects/setup/setup.rkt b/racket/collects/setup/setup.rkt index 8d75431011..9addf1f9ca 100644 --- a/racket/collects/setup/setup.rkt +++ b/racket/collects/setup/setup.rkt @@ -56,5 +56,9 @@ (let/ec esc (parameterize ([exit-handler - (lambda (v) (esc (void)))]) - (setup-core))))) + (lambda (v) (esc (if (and (integer? v) + (<= 1 v 255)) + #f + #t)))]) + (setup-core) + #t))))