packages: Ignore return value of origin snippets.

* guix/packages.scm (patch-and-repack): Ignore return value of SNIPPET
and remove warning about non #t return value.
This commit is contained in:
Ludovic Courtès 2020-11-24 23:29:19 +01:00
parent 4cebe82fa6
commit 325d00e619
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -728,26 +728,17 @@ (define (first-file directory)
(for-each apply-patch '#+patches)
(let ((result #+(if snippet
#~(let ((module (make-fresh-user-module)))
(module-use-interfaces!
module
(map resolve-interface '#+modules))
((@ (system base compile) compile)
'#+snippet
#:to 'value
#:opts %auto-compilation-options
#:env module))
#~#t)))
;; Issue a warning unless the result is #t.
(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")))
#+(if snippet
#~(let ((module (make-fresh-user-module)))
(module-use-interfaces!
module
(map resolve-interface '#+modules))
((@ (system base compile) compile)
'#+snippet
#:to 'value
#:opts %auto-compilation-options
#:env module))
#~#t)
(chdir "..")