From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#27284: [PATCH 3/8] discovery: Move 'file-name->module-name' to (guix modules). Date: Fri, 20 Oct 2017 18:05:52 +0200 Message-ID: <20171020160557.27096-4-ludo@gnu.org> References: <87poamv2i7.fsf@gnu.org> <20171020160557.27096-1-ludo@gnu.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5ZpC-0003eO-5u for bug-guix@gnu.org; Fri, 20 Oct 2017 12:07:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5Zp8-0007Zj-5R for bug-guix@gnu.org; Fri, 20 Oct 2017 12:07:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:43917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5Zp8-0007Zc-1f for bug-guix@gnu.org; Fri, 20 Oct 2017 12:07:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20171020160557.27096-1-ludo@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 27284@debbugs.gnu.org * guix/discovery.scm (file-name->module-name): Move to... * guix/modules.scm (file-name->module-name): ... here. * guix/build/compile.scm: Use (guix modules) instead of (guix discovery). --- guix/build/compile.scm | 2 +- guix/discovery.scm | 12 ++---------- guix/modules.scm | 10 ++++++++++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/guix/build/compile.scm b/guix/build/compile.scm index 6f15ba578..ea0c36fa3 100644 --- a/guix/build/compile.scm +++ b/guix/build/compile.scm @@ -24,7 +24,7 @@ #:use-module (system base target) #:use-module (system base compile) #:use-module (system base message) - #:use-module (guix discovery) + #:use-module (guix modules) #:use-module (guix build utils) #:export (%default-optimizations %lightweight-optimizations diff --git a/guix/discovery.scm b/guix/discovery.scm index c861614b8..7b5757902 100644 --- a/guix/discovery.scm +++ b/guix/discovery.scm @@ -18,15 +18,14 @@ (define-module (guix discovery) #:use-module (guix ui) + #:use-module (guix modules) #:use-module (guix combinators) #:use-module (guix build syscalls) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:use-module (ice-9 vlist) #:use-module (ice-9 ftw) - #:export (file-name->module-name - - scheme-modules + #:export (scheme-modules fold-modules all-modules fold-module-public-variables)) @@ -90,13 +89,6 @@ DIRECTORY is not accessible." directory (strerror errno))) '()))))) -(define file-name->module-name - (let ((not-slash (char-set-complement (char-set #\/)))) - (lambda (file) - "Return the module name (a list of symbols) corresponding to FILE." - (map string->symbol - (string-tokenize (string-drop-right file 4) not-slash))))) - (define* (scheme-modules directory #:optional sub-directory) "Return the list of Scheme modules available under DIRECTORY. Optionally, narrow the search to SUB-DIRECTORY." diff --git a/guix/modules.scm b/guix/modules.scm index 19a4acd76..6c602eda4 100644 --- a/guix/modules.scm +++ b/guix/modules.scm @@ -26,6 +26,9 @@ #:export (missing-dependency-error? missing-dependency-module + file-name->module-name + module-name->file-name + source-module-closure live-module-closure guix-module-name?)) @@ -93,6 +96,13 @@ depends on." (_ '())))))) +(define file-name->module-name + (let ((not-slash (char-set-complement (char-set #\/)))) + (lambda (file) + "Return the module name (a list of symbols) corresponding to FILE." + (map string->symbol + (string-tokenize (string-drop-right file 4) not-slash))))) + (define (module-name->file-name module) "Return the file name for MODULE." (string-append (string-join (map symbol->string module) "/") -- 2.14.2