packages: Issue a warning unless the snippet returns #t.
* guix/packages.scm (patch-and-repack): Issue a warning if the snippet returns a value other than #t.
This commit is contained in:
parent
2a69f48e0f
commit
daac9c77b9
|
@ -566,7 +566,7 @@ specifies modules in scope when evaluating SNIPPET."
|
||||||
|
|
||||||
(for-each apply-patch '#+patches)
|
(for-each apply-patch '#+patches)
|
||||||
|
|
||||||
(unless #+(if snippet
|
(let ((result #+(if snippet
|
||||||
#~(let ((module (make-fresh-user-module)))
|
#~(let ((module (make-fresh-user-module)))
|
||||||
(module-use-interfaces!
|
(module-use-interfaces!
|
||||||
module
|
module
|
||||||
|
@ -576,9 +576,16 @@ specifies modules in scope when evaluating SNIPPET."
|
||||||
#:to 'value
|
#:to 'value
|
||||||
#:opts %auto-compilation-options
|
#:opts %auto-compilation-options
|
||||||
#:env module))
|
#:env module))
|
||||||
#~#t)
|
#~#t)))
|
||||||
(format (current-error-port)
|
;; Issue a warning unless the result is #t.
|
||||||
"snippet returned false, indicating failure~%"))
|
(unless (eqv? result #t)
|
||||||
|
(format (current-error-port) "\
|
||||||
|
## WARNING: the snippet returned `~s'. Return values other than #t
|
||||||
|
## are deprecated. Please migrate this package so that its snippet
|
||||||
|
## reports errors by raising an exception, and otherwise returns #t.~%"
|
||||||
|
result))
|
||||||
|
(unless result
|
||||||
|
(error "snippet returned false")))
|
||||||
|
|
||||||
(chdir "..")
|
(chdir "..")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue