[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
35/104: vm: Use 'let-system'.
From: |
guix-commits |
Subject: |
35/104: vm: Use 'let-system'. |
Date: |
Sun, 17 May 2020 11:36:33 -0400 (EDT) |
nckx pushed a commit to branch core-updates
in repository guix.
commit ba3138ab0f1d9f332a42f2a69a60e3879405c9b8
Author: Ludovic Courtès <address@hidden>
AuthorDate: Fri May 15 22:23:21 2020 +0200
vm: Use 'let-system'.
* gnu/system/vm.scm (expression->derivation-in-linux-vm)[check]: New macro.
[builder]: Use 'let-system' and 'check' instead of referencing
'%current-system' and '%current-target-system'.
---
gnu/system/vm.scm | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 163e8b4..3e483fd 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -199,6 +199,10 @@ substitutable."
(sync)
(reboot))))
+ (define-syntax-rule (check predicate)
+ (let-system (system target)
+ (predicate (or target system))))
+
(let ((initrd (or initrd
(base-initrd file-systems
#:on-error 'backtrace
@@ -229,7 +233,8 @@ substitutable."
(graphs '#$(match references-graphs
(((graph-files . _) ...) graph-files)
(_ #f)))
- (target #$(or (%current-target-system)
(%current-system)))
+ (target #$(let-system (system target)
+ (or target system)))
(size #$(if (eq? 'guess disk-image-size)
#~(+ (* 70 (expt 2 20)) ;ESP
(estimated-partition-size graphs))
@@ -244,12 +249,8 @@ substitutable."
#:memory-size #$memory-size
#:make-disk-image? #$make-disk-image?
#:single-file-output? #$single-file-output?
- ;; FIXME: ‘target-arm32?’ and
- ;; ‘target-aarch64?’ may not operate on the
- ;; right system/target values. Rewrite
- ;; using ‘let-system’ when available.
- #:target-arm32? #$(target-arm32?)
- #:target-aarch64? #$(target-aarch64?)
+ #:target-arm32? #$(check target-arm32?)
+ #:target-aarch64? #$(check target-aarch64?)
#:disk-image-format #$disk-image-format
#:disk-image-size size
#:references-graphs graphs))))))
- 23/104: gnu: kicad: Update to 5.1.6., (continued)
- 23/104: gnu: kicad: Update to 5.1.6., guix-commits, 2020/05/17
- 24/104: gnu: kicad-i18n: Update to 5.1.6., guix-commits, 2020/05/17
- 28/104: gnu: kicad-templates: Update to 5.1.6., guix-commits, 2020/05/17
- 34/104: utils: 'target-arm32?' & co. take an optional parameter., guix-commits, 2020/05/17
- 30/104: gnu: python-libmpsse: Update to 1.4.1., guix-commits, 2020/05/17
- 31/104: bootloader: grub: Refer to the native 'grub-mklayout' and font file., guix-commits, 2020/05/17
- 20/104: gnu: clamav: End snippet in truth., guix-commits, 2020/05/17
- 25/104: gnu: kicad-symbols: Update to 5.1.6., guix-commits, 2020/05/17
- 32/104: gexp: Compilers can now return lowerable objects., guix-commits, 2020/05/17
- 33/104: gexp: Add 'let-system'., guix-commits, 2020/05/17
- 35/104: vm: Use 'let-system'.,
guix-commits <=
- 36/104: linux-initrd: Silence Guile warnings., guix-commits, 2020/05/17
- 37/104: services: shepherd: Silence Guile warnings., guix-commits, 2020/05/17
- 38/104: gnu: matcha-theme: Update to 2020-05-09., guix-commits, 2020/05/17
- 39/104: gnu: papirus-icon-theme: Update to 20200430., guix-commits, 2020/05/17
- 40/104: gnu: delft-icon-theme: Update to 1.12., guix-commits, 2020/05/17
- 41/104: gnu: Add python-pytidylib., guix-commits, 2020/05/17
- 46/104: gnu: fulcrum: Update to 1.1.1., guix-commits, 2020/05/17
- 49/104: gnu: zsh-autosuggestions: Update to 0.6.4., guix-commits, 2020/05/17
- 52/104: gnu: st: Update to 0.8.3., guix-commits, 2020/05/17
- 29/104: gnu: kicad: Re-use common fields in add-ons., guix-commits, 2020/05/17