mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-26 04:29:25 -05:00
discovery: Hide Guile warnings when loading modules.
Fixes <https://issues.guix.gnu.org/43747>. * guix/discovery.scm (scheme-modules): Parameterize 'current-warning-port'.
This commit is contained in:
parent
270b30705d
commit
bedcba8f5c
1 changed files with 19 additions and 13 deletions
|
@ -107,6 +107,12 @@ (define* (scheme-modules directory #:optional sub-directory
|
||||||
(define prefix-len
|
(define prefix-len
|
||||||
(string-length directory))
|
(string-length directory))
|
||||||
|
|
||||||
|
;; Hide Guile warnings such as "source file [...] newer than compiled" when
|
||||||
|
;; loading user code, unless we're hacking on Guix proper. See
|
||||||
|
;; <https://issues.guix.gnu.org/43747>.
|
||||||
|
(parameterize ((current-warning-port (if (getenv "GUIX_UNINSTALLED")
|
||||||
|
(current-warning-port)
|
||||||
|
(%make-void-port "w"))))
|
||||||
(filter-map (lambda (file)
|
(filter-map (lambda (file)
|
||||||
(let* ((relative (string-drop file prefix-len))
|
(let* ((relative (string-drop file prefix-len))
|
||||||
(module (file-name->module-name relative)))
|
(module (file-name->module-name relative)))
|
||||||
|
@ -119,7 +125,7 @@ (module (file-name->module-name relative)))
|
||||||
#f))))
|
#f))))
|
||||||
(scheme-files (if sub-directory
|
(scheme-files (if sub-directory
|
||||||
(string-append directory "/" sub-directory)
|
(string-append directory "/" sub-directory)
|
||||||
directory))))
|
directory)))))
|
||||||
|
|
||||||
(define* (scheme-modules* directory #:optional sub-directory)
|
(define* (scheme-modules* directory #:optional sub-directory)
|
||||||
"Return the list of module names found under SUB-DIRECTORY in DIRECTORY.
|
"Return the list of module names found under SUB-DIRECTORY in DIRECTORY.
|
||||||
|
|
Loading…
Reference in a new issue