Archived
1
0
Fork 0

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'.
This commit is contained in:
Ludovic Courtès 2020-11-05 14:56:16 +01:00
parent 552e9fc163
commit 61d9c4458e
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -118,16 +118,16 @@ ROOT directory to populate the image."
((string=? type "vfat") ((string=? type "vfat")
(make-vfat-image partition target root)) (make-vfat-image partition target root))
(else (else
(format (current-error-port) (raise (condition
"Unsupported partition type~%."))))) (&message
(message "unsupported partition type"))))))))
(define (convert-disk-image image format output) (define (convert-disk-image image format output)
"Convert IMAGE to OUTPUT according to the given FORMAT." "Convert IMAGE to OUTPUT according to the given FORMAT."
(case format (case format
((compressed-qcow2) ((compressed-qcow2)
(begin (invoke "qemu-img" "convert" "-c" "-f" "raw"
(invoke "qemu-img" "convert" "-c" "-f" "raw" "-O" "qcow2" image output))
"-O" "qcow2" image output)))
(else (else
(copy-file image output)))) (copy-file image output))))