Emacs: Upgrade quelpa packages every 7 days.
This commit is contained in:
parent
0a66771a5b
commit
980071fc5e
|
@ -1,6 +1,6 @@
|
|||
;;; package-management.el --- Initialize package management. -*- lexical-binding: t; -*-
|
||||
|
||||
;; Time-stamp: <2020-02-24T22:03:02+0100>
|
||||
;; Time-stamp: <2020-02-26T23:05:38+0100>
|
||||
|
||||
;;; Commentary:
|
||||
;; * Sets up package sources and their priorities.
|
||||
|
@ -10,6 +10,8 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(require 'basics/global-variables)
|
||||
|
||||
(require 'package)
|
||||
(add-to-list 'package-archives
|
||||
'("melpa-stable" . "https://stable.melpa.org/packages/") t)
|
||||
|
@ -79,10 +81,25 @@
|
|||
|
||||
;; Install Emacs packages directly from source.
|
||||
(use-package quelpa
|
||||
:custom ((quelpa-upgrade-p t)
|
||||
(quelpa-self-upgrade-p nil)
|
||||
:demand t
|
||||
:custom ((quelpa-self-upgrade-p nil)
|
||||
(quelpa-update-melpa-p nil)
|
||||
(quelpa-checkout-melpa-p nil))
|
||||
:config
|
||||
(defvar my/quelpa-last-upgrade-file
|
||||
(concat user-emacs-directory "quelpa/last_upgrade")
|
||||
"File with the timestamp of the last quelpa upgrade.")
|
||||
|
||||
(defun my/quelpa-maybe-upgrade ()
|
||||
"Upgrade quelpa packages if the last upgrade was > 7 days ago."
|
||||
(when (or (not (file-exists-p my/quelpa-last-upgrade-file))
|
||||
(> (- (time-to-seconds)
|
||||
(my/file-last-modification my/quelpa-last-upgrade-file))
|
||||
(* 60 60 24 7)))
|
||||
(quelpa-upgrade-all)
|
||||
(write-region "" nil my/quelpa-last-upgrade-file)))
|
||||
|
||||
:hook (after-init . my/quelpa-maybe-upgrade)
|
||||
)
|
||||
|
||||
(provide 'basics/package-management)
|
||||
|
|
Loading…
Reference in New Issue
Block a user