diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2017-05-15 09:05:48 -0700 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-05-20 10:15:47 +0200 |
| commit | 6d1ae43dcb9c754e14723e41ed10298ff100e5a4 (patch) | |
| tree | cb2a0cdd505fa93c697a672bc39963082af37d04 | |
| parent | d03b34cf190b5790ee1884ae551634f5f736f4f1 (diff) | |
profiles: Add elapsed time to manual-database hook to output message.
* guix/profiles.scm (manual-database): Add elapsed time to manual-database
hook to output message.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| -rw-r--r-- | guix/profiles.scm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm index eb172ef450f..6733f105e3c 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm | |||
| @@ -957,6 +957,7 @@ the entries in MANIFEST." | |||
| 957 | #~(begin | 957 | #~(begin |
| 958 | (use-modules (guix build utils) | 958 | (use-modules (guix build utils) |
| 959 | (srfi srfi-1) | 959 | (srfi srfi-1) |
| 960 | (srfi srfi-19) | ||
| 960 | (srfi srfi-26)) | 961 | (srfi srfi-26)) |
| 961 | 962 | ||
| 962 | (define entries | 963 | (define entries |
| @@ -1011,16 +1012,23 @@ the entries in MANIFEST." | |||
| 1011 | (mkdir-p man-directory) | 1012 | (mkdir-p man-directory) |
| 1012 | (setenv "MANPATH" (string-join entries ":")) | 1013 | (setenv "MANPATH" (string-join entries ":")) |
| 1013 | 1014 | ||
| 1014 | (format #t "creating manual page database for ~a packages...~%" | 1015 | (format #t "Creating manual page database for ~a packages... " |
| 1015 | (length entries)) | 1016 | (length entries)) |
| 1016 | (force-output) | 1017 | (force-output) |
| 1017 | 1018 | (let* ((start-time (current-time)) | |
| 1018 | (zero? (system* #+(file-append man-db "/bin/mandb") | 1019 | (exit-status (system* #+(file-append man-db "/bin/mandb") |
| 1019 | "--quiet" "--create" | 1020 | "--quiet" "--create" |
| 1020 | "-C" "man_db.conf")))) | 1021 | "-C" "man_db.conf")) |
| 1022 | (duration (time-difference (current-time) start-time))) | ||
| 1023 | (format #t "done in ~,3f s~%" | ||
| 1024 | (+ (time-second duration) | ||
| 1025 | (* (time-nanosecond duration) (expt 10 -9)))) | ||
| 1026 | (force-output) | ||
| 1027 | (zero? exit-status)))) | ||
| 1021 | 1028 | ||
| 1022 | (gexp->derivation "manual-database" build | 1029 | (gexp->derivation "manual-database" build |
| 1023 | #:modules '((guix build utils) | 1030 | #:modules '((guix build utils) |
| 1031 | (srfi srfi-19) | ||
| 1024 | (srfi srfi-26)) | 1032 | (srfi srfi-26)) |
| 1025 | #:local-build? #t)) | 1033 | #:local-build? #t)) |
| 1026 | 1034 | ||
