From d46c4423f46278bd2f96770ceb0667431414349e Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 18 Jun 2017 00:02:56 +0200 Subject: discovery: 'scheme-files' returns '() for a non-accessible directory. Fixes a regression introduced in d27cc3bfaafe6b5b0831e88afb1c46311d382a0b. Reported by Ricardo Wurmus . * guix/discovery.scm (scheme-files): Catch 'scandir*' system errors. Return '() and optionally raise a warning upon 'system-error'. * tests/discovery.scm ("scheme-modules, non-existent directory"): New test. --- tests/discovery.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/discovery.scm') diff --git a/tests/discovery.scm b/tests/discovery.scm index b838731e16..04de83f085 100644 --- a/tests/discovery.scm +++ b/tests/discovery.scm @@ -32,6 +32,10 @@ ((('guix 'import _ ...) ..1) #t))) +(test-equal "scheme-modules, non-existent directory" + '() + (scheme-modules "/does/not/exist")) + (test-assert "all-modules" (match (map module-name (all-modules `((,%top-srcdir . "guix/build-system")))) -- cgit v1.2.3