From 7889394e059a2362d3227fb02256de4afd46129c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Fri, 16 May 2014 21:56:00 +0200
Subject: [PATCH] guix system: Add 'build' action.

* guix/scripts/system.scm (show-help): Document 'build' action.
  (guix-system): Honor 'build' action.
* doc/guix.texi (Invoking guix system): Add 'build' action.
---
 doc/guix.texi           |  5 +++++
 guix/scripts/system.scm | 19 +++++++++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 770e7ab0629..4881ec6e1b2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3204,6 +3204,11 @@ operating system is instantiate.  Currently the following values are
 supported:
 
 @table @code
+@item build
+Build the operating system's derivation, which includes all the
+configuration files and programs needed to boot and run the system.
+This action does not actually install anything.
+
 @item vm
 @cindex virtual machine
 Build a virtual machine that contain the operating system declared in
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 582027244cf..0739534b577 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -24,6 +24,7 @@ (define-module (guix scripts system)
   #:use-module (guix utils)
   #:use-module (guix monads)
   #:use-module (guix scripts build)
+  #:use-module (gnu system)
   #:use-module (gnu system vm)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-37)
@@ -71,9 +72,15 @@ (define (read-operating-system file)
 (define (show-help)
   (display (_ "Usage: guix system [OPTION] ACTION FILE
 Build the operating system declared in FILE according to ACTION.\n"))
-  (display (_ "Currently the only valid values for ACTION are 'vm', which builds
-a virtual machine of the given operating system that shares the host's store,
-and 'vm-image', which builds a virtual machine image that stands alone.\n"))
+  (newline)
+  (display (_ "The valid values for ACTION are:\n"))
+  (display (_ "\
+  - 'build', build the operating system without installing anything\n"))
+  (display (_ "\
+  - 'vm', build a virtual machine image that shares the host's store\n"))
+  (display (_ "\
+  - 'vm-image', build a freestanding virtual machine image.\n"))
+
   (show-build-options-help)
   (display (_ "
       --image-size=SIZE  for 'vm-image', produce an image of SIZE"))
@@ -131,9 +138,7 @@ (define (parse-options)
                             (alist-cons 'argument arg result)))
                       (let ((action (string->symbol arg)))
                         (case action
-                          ((vm)
-                           (alist-cons 'action action result))
-                          ((vm-image)
+                          ((build vm vm-image)
                            (alist-cons 'action action result))
                           (else (leave (_ "~a: unknown action~%")
                                        action))))))
@@ -147,6 +152,8 @@ (define (parse-options)
                        (read-operating-system file)
                        (leave (_ "no configuration file specified~%"))))
            (mdrv   (case action
+                     ((build)
+                      (operating-system-derivation os))
                      ((vm-image)
                       (let ((size (assoc-ref opts 'image-size)))
                         (system-qemu-image os
-- 
GitLab