diff options
author | Marius Bakke <mbakke@fastmail.com> | 2017-05-27 03:55:24 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2017-05-27 03:55:24 +0200 |
commit | 9df24909e252980c2393d2baaa617c30db8c9dd8 (patch) | |
tree | a32bd0d0b993f05a51bd8f49993be99c0770262d /guix/modules.scm | |
parent | ae40e02cd68d4e0ab10690bd4e59c698df472857 (diff) | |
parent | fdabfdbf8d5e179b2726ae69ff8aec48b0504788 (diff) |
Merge branch 'master' into staging
Diffstat (limited to 'guix/modules.scm')
-rw-r--r-- | guix/modules.scm | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/guix/modules.scm b/guix/modules.scm index 24b5903579..19a4acd76c 100644 --- a/guix/modules.scm +++ b/guix/modules.scm @@ -20,8 +20,13 @@ #:use-module (guix memoization) #:use-module (guix sets) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module (ice-9 match) - #:export (source-module-closure + #:export (missing-dependency-error? + missing-dependency-module + + source-module-closure live-module-closure guix-module-name?)) @@ -35,6 +40,11 @@ ;;; ;;; Code: +;; The error corresponding to a missing module. +(define-condition-type &missing-dependency-error &error + missing-dependency-error? + (module missing-dependency-module)) + (define (colon-symbol? obj) "Return true if OBJ is a symbol that starts with a colon." (and (symbol? obj) @@ -106,9 +116,12 @@ depends on." "Return the modules used by MODULE by looking at its source code." (if (member module %source-less-modules) '() - (module-file-dependencies - (search-path load-path - (module-name->file-name module))))) + (match (search-path load-path (module-name->file-name module)) + ((? string? file) + (module-file-dependencies file)) + (#f + (raise (condition (&missing-dependency-error + (module module)))))))) (define* (module-closure modules #:key |