Archived
1
0
Fork 0

gexp: Remove more uses of #:modules.

* guix/scripts/system.scm (switch-to-system): Adjust comment.
* tests/gexp.scm ("gexp->derivation #:references-graphs"): Use
'with-imported-modules' instead of #:modules.
* tests/grafts.scm ("graft-derivation, preserve empty directories"):
Likewise.
This commit is contained in:
Ludovic Courtès 2016-07-12 18:00:16 +02:00
parent 9c14a487bb
commit 66a35ceb43
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 27 additions and 27 deletions

View file

@ -362,7 +362,7 @@ it atomically, and then run OS's activation script."
;; The activation script may modify '%load-path' & co., so protect ;; The activation script may modify '%load-path' & co., so protect
;; against that. This is necessary to ensure that ;; against that. This is necessary to ensure that
;; 'upgrade-shepherd-services' gets to see the right modules when it ;; 'upgrade-shepherd-services' gets to see the right modules when it
;; computes derivations with (gexp->derivation #:modules …). ;; computes derivations with 'gexp->derivation'.
(save-load-path-excursion (save-load-path-excursion
(primitive-load (derivation->output-path script)))) (primitive-load (derivation->output-path script))))

View file

@ -601,26 +601,26 @@
((one (text-file "one" (random-text))) ((one (text-file "one" (random-text)))
(two (gexp->derivation "two" (two (gexp->derivation "two"
#~(symlink #$one #$output:chbouib))) #~(symlink #$one #$output:chbouib)))
(drv (gexp->derivation "ref-graphs" (build -> (with-imported-modules '((guix build store-copy)
#~(begin (guix build utils))
(use-modules (guix build store-copy)) #~(begin
(with-output-to-file #$output (use-modules (guix build store-copy))
(lambda () (with-output-to-file #$output
(write (call-with-input-file "guile" (lambda ()
read-reference-graph)))) (write (call-with-input-file "guile"
(with-output-to-file #$output:one read-reference-graph))))
(lambda () (with-output-to-file #$output:one
(write (call-with-input-file "one" (lambda ()
read-reference-graph)))) (write (call-with-input-file "one"
(with-output-to-file #$output:two read-reference-graph))))
(lambda () (with-output-to-file #$output:two
(write (call-with-input-file "two" (lambda ()
read-reference-graph))))) (write (call-with-input-file "two"
read-reference-graph)))))))
(drv (gexp->derivation "ref-graphs" build
#:references-graphs `(("one" ,one) #:references-graphs `(("one" ,one)
("two" ,two "chbouib") ("two" ,two "chbouib")
("guile" ,%bootstrap-guile)) ("guile" ,%bootstrap-guile))))
#:modules '((guix build store-copy)
(guix build utils))))
(ok? (built-derivations (list drv))) (ok? (built-derivations (list drv)))
(guile-drv (package->derivation %bootstrap-guile)) (guile-drv (package->derivation %bootstrap-guile))
(bash (interned-file (search-bootstrap-binary "bash" (bash (interned-file (search-bootstrap-binary "bash"

View file

@ -135,14 +135,14 @@
(replacement fake))) (replacement fake)))
(drv (gexp->derivation (drv (gexp->derivation
"to-graft" "to-graft"
#~(begin (with-imported-modules '((guix build utils))
(use-modules (guix build utils)) #~(begin
(mkdir-p (string-append #$output (use-modules (guix build utils))
"/a/b/c/d")) (mkdir-p (string-append #$output
(symlink #$%bash "/a/b/c/d"))
(string-append #$output (symlink #$%bash
"/bash"))) (string-append #$output
#:modules '((guix build utils)))) "/bash"))))))
(grafted ((store-lift graft-derivation) drv (grafted ((store-lift graft-derivation) drv
(list graft))) (list graft)))
(_ (built-derivations (list grafted))) (_ (built-derivations (list grafted)))