mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
profiles: 'manual-database' hook reports progress.
* guix/profiles.scm (manual-database)[build](compute-entries): Write a progress report.
This commit is contained in:
parent
35ef5bc866
commit
f6fe7da372
1 changed files with 18 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
|
||||
;;; Copyright © 2014, 2016 Alex Kost <alezost@gmail.com>
|
||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||
|
@ -1300,12 +1300,22 @@ (define build
|
|||
(srfi srfi-19))
|
||||
|
||||
(define (compute-entries)
|
||||
(append-map (lambda (directory)
|
||||
(let ((man (string-append directory "/share/man")))
|
||||
(if (directory-exists? man)
|
||||
(mandb-entries man)
|
||||
'())))
|
||||
'#$(manifest-inputs manifest)))
|
||||
;; This is the most expensive part (I/O and CPU, due to
|
||||
;; decompression), so report progress as we traverse INPUTS.
|
||||
(let* ((inputs '#$(manifest-inputs manifest))
|
||||
(total (length inputs)))
|
||||
(append-map (lambda (directory count)
|
||||
(format #t "\r[~3d/~3d] building list of \
|
||||
man-db entries..."
|
||||
count total)
|
||||
(force-output)
|
||||
(let ((man (string-append directory
|
||||
"/share/man")))
|
||||
(if (directory-exists? man)
|
||||
(mandb-entries man)
|
||||
'())))
|
||||
inputs
|
||||
(iota total 1))))
|
||||
|
||||
(define man-directory
|
||||
(string-append #$output "/share/man"))
|
||||
|
@ -1320,6 +1330,7 @@ (define man-directory
|
|||
"/index.db")
|
||||
entries))
|
||||
(duration (time-difference (current-time) start)))
|
||||
(newline)
|
||||
(format #t "~a entries processed in ~,1f s~%"
|
||||
(length entries)
|
||||
(+ (time-second duration)
|
||||
|
|
Loading…
Reference in a new issue