aboutsummaryrefslogtreecommitdiff
path: root/gnu/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-11-05 14:56:16 +0100
committerLudovic Courtès <ludo@gnu.org>2020-11-05 16:13:50 +0100
commit61d9c4458eef35a2a3fce94f113031d86b9f4d8d (patch)
tree43b7a1f8d659178b43f9a5333a70ad63be965ca0 /gnu/build
parent552e9fc163f61721e03d31a5749a0f8011908901 (diff)
downloadguix-61d9c4458eef35a2a3fce94f113031d86b9f4d8d.tar
guix-61d9c4458eef35a2a3fce94f113031d86b9f4d8d.tar.gz
image: Error out when passed an unsupported partition type.
* gnu/build/image.scm (make-partition-image): Use 'raise' instead of 'format' when TYPE is not supported. (convert-disk-image): Remove unneeded 'begin'.
Diffstat (limited to 'gnu/build')
-rw-r--r--gnu/build/image.scm10
1 files changed, 5 insertions, 5 deletions
diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 8a2d0eb5fd..640a784204 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -118,16 +118,16 @@ ROOT directory to populate the image."
((string=? type "vfat")
(make-vfat-image partition target root))
(else
- (format (current-error-port)
- "Unsupported partition type~%.")))))
+ (raise (condition
+ (&message
+ (message "unsupported partition type"))))))))
(define (convert-disk-image image format output)
"Convert IMAGE to OUTPUT according to the given FORMAT."
(case format
((compressed-qcow2)
- (begin
- (invoke "qemu-img" "convert" "-c" "-f" "raw"
- "-O" "qcow2" image output)))
+ (invoke "qemu-img" "convert" "-c" "-f" "raw"
+ "-O" "qcow2" image output))
(else
(copy-file image output))))