parent
c15d2f71d4
commit
c7fac6e98e
|
@ -1026,6 +1026,15 @@ for @nonterm{key}.
|
||||||
@item{@DFlag{version} @nonterm{version} or @Flag{v} @nonterm{version} --- Copies catalog
|
@item{@DFlag{version} @nonterm{version} or @Flag{v} @nonterm{version} --- Copies catalog
|
||||||
results specific to @nonterm{version}
|
results specific to @nonterm{version}
|
||||||
(for catalogs that make a distinction), instead of the installation's Racket version.}
|
(for catalogs that make a distinction), instead of the installation's Racket version.}
|
||||||
|
@item{@DFlag{pkg-fail} @nonterm{mode} --- Determines handling of failure for an individual
|
||||||
|
package, such as when a @nonterm{src-catalog} contains a bad package source. The
|
||||||
|
following @nonterm{mode}s are available:
|
||||||
|
@itemlist[
|
||||||
|
@item{@exec{fail} (the default) --- archiving stops and fails;}
|
||||||
|
@item{@exec{skip} --- the package is skipped and omitted from the archive catalog; or}
|
||||||
|
@item{@exec{continue} --- like @exec{skip}, but @exec{raco pkg catalog-archive}
|
||||||
|
exits with a status code of @exec{5} if any package was skipped.}
|
||||||
|
]}
|
||||||
]
|
]
|
||||||
|
|
||||||
@history[#:added "6.0.17"]
|
@history[#:added "6.0.17"]
|
||||||
|
|
|
@ -581,15 +581,37 @@
|
||||||
[(#:str state-database #f) state () "Read/write <state-database> as state of <dest-dir>"]
|
[(#:str state-database #f) state () "Read/write <state-database> as state of <dest-dir>"]
|
||||||
[(#:str vers #f) version ("-v") "Copy information suitable for Racket <vers>"]
|
[(#:str vers #f) version ("-v") "Copy information suitable for Racket <vers>"]
|
||||||
[#:bool relative () "Make source paths relative when possible"]
|
[#:bool relative () "Make source paths relative when possible"]
|
||||||
|
[(#:sym mode [fail ignore continue] 'fail) pkg-fail ()
|
||||||
|
("Select handling of package-download failure;"
|
||||||
|
"<mode>s: fail (the default), skip, continue (but with exit status of 5)")]
|
||||||
#:args (dest-dir . src-catalog)
|
#:args (dest-dir . src-catalog)
|
||||||
(parameterize ([current-pkg-error (pkg-error 'catalog-archive)]
|
(parameterize ([current-pkg-error (pkg-error 'catalog-archive)]
|
||||||
[current-pkg-lookup-version (or version
|
[current-pkg-lookup-version (or version
|
||||||
(current-pkg-lookup-version))])
|
(current-pkg-lookup-version))])
|
||||||
|
(define fail-at-end? #f)
|
||||||
(pkg-catalog-archive dest-dir
|
(pkg-catalog-archive dest-dir
|
||||||
src-catalog
|
src-catalog
|
||||||
#:from-config? from-config
|
#:from-config? from-config
|
||||||
#:state-catalog state
|
#:state-catalog state
|
||||||
#:relative-sources? relative))]
|
#:relative-sources? relative
|
||||||
|
#:package-exn-handler (case pkg-fail
|
||||||
|
[(fail) (lambda (name exn) (raise exn))]
|
||||||
|
[(skip continue)
|
||||||
|
(lambda (name exn)
|
||||||
|
(log-error (~a "archiving failed for package; ~a\n"
|
||||||
|
" package name: ~a\n"
|
||||||
|
" original error:\n~a")
|
||||||
|
(if (eq? pkg-fail 'continue)
|
||||||
|
"continuing"
|
||||||
|
"skipping")
|
||||||
|
name
|
||||||
|
(regexp-replace* #rx"(?m:^)"
|
||||||
|
(exn-message exn)
|
||||||
|
" "))
|
||||||
|
(when (eq? pkg-fail 'continue)
|
||||||
|
(set! fail-at-end? #t)))]))
|
||||||
|
(when fail-at-end?
|
||||||
|
(exit 5)))]
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
[archive
|
[archive
|
||||||
"Create catalog from installed packages"
|
"Create catalog from installed packages"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user