From d77a0bd6f1aa709fcec1041fcdde33942335d75b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 4 Aug 2016 19:08:08 +0200 Subject: ui: Remove dependency on (gnu system file-systems). * guix/ui.scm (specification->file-system-mapping): Move to... * gnu/system/file-systems.scm (specification->file-system-mapping): ... here. --- gnu/system/file-systems.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gnu') diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index f4cfaf0990..116e2813e8 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -40,6 +40,7 @@ (define-module (gnu system file-systems) file-system-dependencies file-system->spec + specification->file-system-mapping uuid %fuse-control-file-system @@ -105,6 +106,23 @@ (define (file-system->spec fs) (($ device title mount-point type flags options _ _ check?) (list device title mount-point type flags options check?)))) +(define (specification->file-system-mapping spec writable?) + "Read the SPEC and return the corresponding . SPEC is +a string of the form \"SOURCE\" or \"SOURCE=TARGET\". The former specifies +that SOURCE from the host should be mounted at SOURCE in the other system. +The latter format specifies that SOURCE from the host should be mounted at +TARGET in the other system." + (let ((index (string-index spec #\=))) + (if index + (file-system-mapping + (source (substring spec 0 index)) + (target (substring spec (+ 1 index))) + (writable? writable?)) + (file-system-mapping + (source spec) + (target spec) + (writable? writable?))))) + (define-syntax uuid (lambda (s) "Return the bytevector corresponding to the given UUID representation." -- cgit v1.2.3