me
/
guix
Archived
1
0
Fork 0

discovery: Move 'file-name->module-name' to (guix modules).

* 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).
master
Ludovic Courtès 2017-10-13 22:16:46 +02:00
parent 3a9976bfcd
commit 7a51c78c6e
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
3 changed files with 13 additions and 11 deletions

View File

@ -24,7 +24,7 @@
#:use-module (system base target) #:use-module (system base target)
#:use-module (system base compile) #:use-module (system base compile)
#:use-module (system base message) #:use-module (system base message)
#:use-module (guix discovery) #:use-module (guix modules)
#:use-module (guix build utils) #:use-module (guix build utils)
#:export (%default-optimizations #:export (%default-optimizations
%lightweight-optimizations %lightweight-optimizations

View File

@ -18,15 +18,14 @@
(define-module (guix discovery) (define-module (guix discovery)
#:use-module (guix ui) #:use-module (guix ui)
#:use-module (guix modules)
#:use-module (guix combinators) #:use-module (guix combinators)
#:use-module (guix build syscalls) #:use-module (guix build syscalls)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (ice-9 match) #:use-module (ice-9 match)
#:use-module (ice-9 vlist) #:use-module (ice-9 vlist)
#:use-module (ice-9 ftw) #:use-module (ice-9 ftw)
#:export (file-name->module-name #:export (scheme-modules
scheme-modules
fold-modules fold-modules
all-modules all-modules
fold-module-public-variables)) fold-module-public-variables))
@ -90,13 +89,6 @@ DIRECTORY is not accessible."
directory (strerror errno))) 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) (define* (scheme-modules directory #:optional sub-directory)
"Return the list of Scheme modules available under DIRECTORY. "Return the list of Scheme modules available under DIRECTORY.
Optionally, narrow the search to SUB-DIRECTORY." Optionally, narrow the search to SUB-DIRECTORY."

View File

@ -26,6 +26,9 @@
#:export (missing-dependency-error? #:export (missing-dependency-error?
missing-dependency-module missing-dependency-module
file-name->module-name
module-name->file-name
source-module-closure source-module-closure
live-module-closure live-module-closure
guix-module-name?)) 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) (define (module-name->file-name module)
"Return the file name for MODULE." "Return the file name for MODULE."
(string-append (string-join (map symbol->string module) "/") (string-append (string-join (map symbol->string module) "/")