gnu: surgescript: Update to 0.5.4.4.
[jackhill/guix/guix.git] / guix / man-db.scm
index 5d62e0c..a6528e4 100644 (file)
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -17,8 +17,9 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (guix man-db)
-  #:use-module (guix zlib)
+  #:use-module (zlib)
   #:use-module ((guix build utils) #:select (find-files))
+  #:use-module (gdbm)                             ;gdbm-ffi
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-26)
   #:use-module (ice-9 match)
@@ -44,9 +45,6 @@
 ;;;
 ;;; Code:
 
-;; Load 'gdbm-ffi' at run time to simplify the job of 'imported-modules' & co.
-(module-autoload! (current-module) '(gdbm) '(gdbm-open GDBM_WRCREAT))
-
 (define-record-type <mandb-entry>
   (mandb-entry file-name name section synopsis kind)
   mandb-entry?
 
 (define (man-files directory)
   "Return the list of man pages found under DIRECTORY, recursively."
-  (find-files directory "\\.[0-9][a-z]?(\\.gz)?$"))
+  ;; Filter the list to ensure that broken symlinks are excluded.
+  (filter file-exists? (find-files directory "\\.[0-9][a-z]?(\\.gz)?$")))
 
 (define (mandb-entries directory)
   "Return mandb entries for the man pages found under DIRECTORY, recursively."