mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-18 21:46:35 +01:00
cve: Disable position recording while reading the CVE list.
* guix/cve.scm (fetch-vulnerabilities)[read*]: New procedure. Use it in lieu of 'read'.
This commit is contained in:
parent
6ab63268e4
commit
f1b65d0dd9
1 changed files with 15 additions and 2 deletions
17
guix/cve.scm
17
guix/cve.scm
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2015, 2016 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -229,11 +229,24 @@ (define (old? file)
|
|||
(now (current-time time-utc)))
|
||||
(< (+ (stat:mtime s) ttl) (time-second now))))
|
||||
|
||||
(define (read* port)
|
||||
;; Disable read options to avoid populating the source property weak
|
||||
;; table, which speeds things up, saves memory, and works around
|
||||
;; <https://lists.gnu.org/archive/html/guile-devel/2017-09/msg00031.html>.
|
||||
(let ((options (read-options)))
|
||||
(dynamic-wind
|
||||
(lambda ()
|
||||
(read-disable 'positions))
|
||||
(lambda ()
|
||||
(read port))
|
||||
(lambda ()
|
||||
(read-options options)))))
|
||||
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(if (old? cache)
|
||||
(update-cache)
|
||||
(match (call-with-input-file cache read)
|
||||
(match (call-with-input-file cache read*)
|
||||
(('vulnerabilities 1 vulns)
|
||||
(map sexp->vulnerability vulns))
|
||||
(x
|
||||
|
|
Loading…
Reference in a new issue