diff --git a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/lib.scrbl b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/lib.scrbl index 776e9a9ea6..7ebd91832b 100644 --- a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/lib.scrbl +++ b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/lib.scrbl @@ -368,15 +368,24 @@ for extracting existing catalog information. [#:from-config? from-config? boolean? #f] [#:state-catalog state-catalog (or/c #f path-string?) #f] [#:relative-sources? relative-sources? boolean? #f] - [#:quiet? quiet? boolean? #f]) + [#:quiet? quiet? boolean? #f] + [#:package-exn-handler package-exn-handler (string? exn:fail? . -> . any) (lambda (_pkg-name _exn) (raise _exn))]) void?]{ Implements @racket[pkg-catalog-archive-command]. +The @racket[package-exn-handler] argument handles any exception that +is raised while trying to archive an individual package; the first +argument is the package name, and the second is the exception. The +default re-@racket[raise]s the exception, which aborts the archiving +process, while a function that logs the exception message and returns +would allow archiving to continue for other packages. + The @racket[current-pkg-lookup-version] parameter determines the version for extracting existing catalog information. -@history[#:added "6.0.1.7"]} +@history[#:added "6.0.1.7" + #:changed "6.0.1.13" @elem{Added the @racket[#:package-exn-handler] argument.}]} @defproc[(pkg-catalog-update-local [#:catalogs catalogs (listof string?) (pkg-config-catalogs)] diff --git a/racket/collects/pkg/lib.rkt b/racket/collects/pkg/lib.rkt index d1d3d799e9..52193e33fd 100644 --- a/racket/collects/pkg/lib.rkt +++ b/racket/collects/pkg/lib.rkt @@ -3175,7 +3175,8 @@ #:set-catalogs? [set-catalogs? #t] #:catalog-file [catalog-file (db:current-pkg-catalog-file)] #:quiet? [quiet? #f] - #:consult-packages? [consult-packages? #f]) + #:consult-packages? [consult-packages? #f] + #:skip-download-failures? [skip-download-failures? #f]) (parameterize ([db:current-pkg-catalog-file catalog-file]) (define current-catalogs (db:get-catalogs)) (cond @@ -3242,7 +3243,8 @@ #:from-config? [from-config? #f] #:state-catalog [state-catalog #f] #:relative-sources? [relative-sources? #f] - #:quiet? [quiet? #f]) + #:quiet? [quiet? #f] + #:package-exn-handler [package-exn-handler (lambda (name exn) (raise exn))]) (when (and state-catalog (not (db-path? (if (path? state-catalog) state-catalog @@ -3281,56 +3283,58 @@ ;; Check on each new package: (for ([pkg (in-list (sort pkgs stringstring (path-replace-suffix pkg-file #".zip.CHECKSUM"))) - (parameterize ([db:current-pkg-catalog-file temp-catalog-file]) - (define modules (db:get-pkg-modules name (db:pkg-catalog pkg) (or current-checksum ""))) - (define dependencies (db:get-pkg-dependencies name (db:pkg-catalog pkg) (or current-checksum ""))) - (db:set-pkg! name (db:pkg-catalog pkg) - (db:pkg-author pkg) - (path->string (path->complete-path pkg-file)) - new-checksum - (db:pkg-desc pkg)) - (db:set-pkg-modules! name (db:pkg-catalog pkg) - new-checksum - modules) - (db:set-pkg-dependencies! name (db:pkg-catalog pkg) - new-checksum - dependencies))) + (define pkg-file (build-path dest-dir "pkgs" (format "~a.zip" name))) + (define new-checksum + (file->string (path-replace-suffix pkg-file #".zip.CHECKSUM"))) + (parameterize ([db:current-pkg-catalog-file temp-catalog-file]) + (define modules (db:get-pkg-modules name (db:pkg-catalog pkg) (or current-checksum ""))) + (define dependencies (db:get-pkg-dependencies name (db:pkg-catalog pkg) (or current-checksum ""))) + (db:set-pkg! name (db:pkg-catalog pkg) + (db:pkg-author pkg) + (path->string (path->complete-path pkg-file)) + new-checksum + (db:pkg-desc pkg)) + (db:set-pkg-modules! name (db:pkg-catalog pkg) + new-checksum + modules) + (db:set-pkg-dependencies! name (db:pkg-catalog pkg) + new-checksum + dependencies)))) (define dest-catalog (build-path dest-dir "catalog")) (unless quiet? (printf/flush "Creating catalog ~a\n" dest-catalog)) @@ -3495,7 +3499,8 @@ (#:from-config? boolean? #:state-catalog (or/c path-string? #f) #:relative-sources? boolean? - #:quiet? boolean?) + #:quiet? boolean? + #:package-exn-handler (string? exn:fail? . -> . any)) void?)] [default-pkg-scope (-> package-scope/c)]