mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-02-10 21:50:01 +01:00
grafts: Add 'without-grafting'.
* guix/grafts.scm (call-without-grafting): New procedure. (without-grafting): New macro.
This commit is contained in:
parent
89b0c2390a
commit
565733c4d7
1 changed files with 12 additions and 0 deletions
|
@ -42,6 +42,7 @@
|
|||
graft-derivation/shallow
|
||||
|
||||
%graft?
|
||||
without-grafting
|
||||
set-grafting
|
||||
grafting?))
|
||||
|
||||
|
@ -323,6 +324,17 @@ DRV, and graft DRV itself to refer to those grafted dependencies."
|
|||
;; Whether to honor package grafts by default.
|
||||
(make-parameter #t))
|
||||
|
||||
(define (call-without-grafting thunk)
|
||||
(lambda (store)
|
||||
(values (parameterize ((%graft? #f))
|
||||
(run-with-store store (thunk)))
|
||||
store)))
|
||||
|
||||
(define-syntax-rule (without-grafting mexp ...)
|
||||
"Bind monadic expressions MEXP in a dynamic extent where '%graft?' is
|
||||
false."
|
||||
(call-without-grafting (lambda () (mbegin %store-monad mexp ...))))
|
||||
|
||||
(define-inlinable (set-grafting enable?)
|
||||
;; This monadic procedure enables grafting when ENABLE? is true, and
|
||||
;; disables it otherwise. It returns the previous setting.
|
||||
|
|
Loading…
Add table
Reference in a new issue