summaryrefslogtreecommitdiff
path: root/guix/cve.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2017-10-01 19:59:55 +0300
committerEfraim Flashner <efraim@flashner.co.il>2017-10-01 22:16:22 +0300
commit64df08f0cfac8f7a329002afa3461fd62a4b229c (patch)
tree019909423138ceb49cdd86f1af48d366503db68f /guix/cve.scm
parentb83ad3ace56c65a367e8f58c7b78323cf251b94b (diff)
parent0ef1c223071869488c35b72b7407234c11425589 (diff)
downloadguix-patches-64df08f0cfac8f7a329002afa3461fd62a4b229c.tar
guix-patches-64df08f0cfac8f7a329002afa3461fd62a4b229c.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'guix/cve.scm')
-rw-r--r--guix/cve.scm17
1 files changed, 15 insertions, 2 deletions
diff --git a/guix/cve.scm b/guix/cve.scm
index 088e39837a..38e59944c8 100644
--- a/guix/cve.scm
+++ b/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 @@ the given TTL (fetch from the NIST web site when TTL has expired)."
(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