Emacs: Don't update keyring every time.

This commit is contained in:
tastytea 2019-12-04 07:07:48 +01:00
parent 8706a77ed0
commit 5e34b6c28d

View File

@ -1,6 +1,6 @@
;;; package-management.el --- Initialize package management. -*- lexical-binding: t; -*- ;;; package-management.el --- Initialize package management. -*- lexical-binding: t; -*-
;; Time-stamp: <2019-11-29T23:00:40+00:00> ;; Time-stamp: <2019-12-04T06:07:31+00:00>
;;; Commentary: ;;; Commentary:
;; * Sets up package sources and their priorities. ;; * Sets up package sources and their priorities.
@ -52,7 +52,14 @@
;; Tool for updating the GNU ELPA keyring. ;; Tool for updating the GNU ELPA keyring.
(use-package gnu-elpa-keyring-update (use-package gnu-elpa-keyring-update
:config :config
(gnu-elpa-keyring-update) ; Update keyring on each start. (defvar my/keyring-last-access
(time-to-seconds
(nth 4 (file-attributes (gnu-elpa-keyring-update--keyring))))
"Last access time for the GNU ELPA keyring.")
;; Only update keyring if atime (mtime with relatime) is > 1 week ago.
(if (> (- (time-to-seconds) my/keyring-last-access) (* 60 60 24 7))
(gnu-elpa-keyring-update))
) )
;; Update packages if at least 7 days have passed. ;; Update packages if at least 7 days have passed.