unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Craven <david@craven.ch>
To: guix-devel@gnu.org
Subject: [PATCH] system: Remove spec->file-system.
Date: Fri,  2 Dec 2016 19:37:16 +0100	[thread overview]
Message-ID: <20161202183716.25174-1-david@craven.ch> (raw)

* gnu/system/file-systems.scm (spec->file-system): Remove variable.
* gnu/system/linux-container.scm (container-script): Refactor.
---
 gnu/system/file-systems.scm    | 11 -----------
 gnu/system/linux-container.scm |  6 ++----
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 4cc1221..b51d57f 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -40,7 +40,6 @@
             file-system-dependencies
 
             file-system->spec
-            spec->file-system
             specification->file-system-mapping
             uuid
 
@@ -108,16 +107,6 @@ initrd code."
     (($ <file-system> device title mount-point type flags options _ _ check?)
      (list device title mount-point type flags options check?))))
 
-(define (spec->file-system sexp)
-  "Deserialize SEXP, a list, to the corresponding <file-system> object."
-  (match sexp
-    ((device title mount-point type flags options check?)
-     (file-system
-       (device device) (title title)
-       (mount-point mount-point) (type type)
-       (flags flags) (options options)
-       (check? check?)))))
-
 (define (specification->file-system-mapping spec writable?)
   "Read the SPEC and return the corresponding <file-system-mapping>.  SPEC is
 a string of the form \"SOURCE\" or \"SOURCE=TARGET\".  The former specifies
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index 24e61c3..0146df1 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -81,8 +81,7 @@ MAPPINGS is a list of <file-system> objects that specify the files/directories
 that will be shared with the host system."
   (let* ((os           (containerized-operating-system os mappings))
          (file-systems (filter file-system-needed-for-boot?
-                               (operating-system-file-systems os)))
-         (specs        (map file-system->spec file-systems)))
+                               (operating-system-file-systems os))))
 
     (mlet* %store-monad ((os-drv (operating-system-derivation
                                   os
@@ -94,10 +93,9 @@ that will be shared with the host system."
                                   (gnu build linux-container)))
           #~(begin
               (use-modules (gnu build linux-container)
-                           (gnu system file-systems) ;spec->file-system
                            (guix build utils))
 
-              (call-with-container (map spec->file-system '#$specs)
+              (call-with-container #$file-systems
                 (lambda ()
                   (setenv "HOME" "/root")
                   (setenv "TMPDIR" "/tmp")
-- 
2.9.0

             reply	other threads:[~2016-12-02 18:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 18:37 David Craven [this message]
2016-12-02 23:23 ` [PATCH] system: Remove spec->file-system David Craven
2016-12-04 15:48 ` Ludovic Courtès
2016-12-04 16:19   ` David Craven
2016-12-05 20:58     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161202183716.25174-1-david@craven.ch \
    --to=david@craven.ch \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).