summaryrefslogtreecommitdiff
path: root/guix/scripts/system.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2022-08-30 19:21:16 +0200
committerMathieu Othacehe <othacehe@gnu.org>2022-08-30 19:29:58 +0200
commit6454164412ef8b0c5e5bd08b7b584cddd0784515 (patch)
tree3552c374547ef0a290f03c8a6d83b4a02e9e22da /guix/scripts/system.scm
parent0518a88a4e417d6369859ff1da6448e1a6e693da (diff)
scripts: system: Check the image operating-system.
* guix/scripts/system.scm (process-action): Check that the provided image has a defined operating-system.
Diffstat (limited to 'guix/scripts/system.scm')
-rw-r--r--guix/scripts/system.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 443e9d3282..4bcf789703 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -41,6 +41,7 @@
#:use-module (guix grafts)
#:use-module (guix gexp)
#:use-module (guix derivations)
+ #:use-module (guix diagnostics)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix monads)
@@ -1257,7 +1258,10 @@ resulting from command-line parsing."
(size image-size)
(volatile-root? volatile?)
(shared-network? shared-network?))))
- (os (image-operating-system image))
+ (os (or (image-operating-system image)
+ (raise
+ (formatted-message
+ (G_ "image lacks an operating-system")))))
(target-file (match args
((first second) second)
(_ #f)))