Remove https from package-archives dynamically

This commit is contained in:
Henrik Lissner 2018-05-14 15:57:54 +02:00
parent 310d81ab4a
commit f2eedb44dc
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -92,18 +92,15 @@ and `auto-mode-alist'.")
(defvar doom--refreshed-p nil)
(defvar generated-autoload-load-name)
;;
(setq autoload-compute-prefixes nil
package--init-file-ensured t
package-user-dir (expand-file-name "elpa" doom-packages-dir)
package-enable-at-startup nil
package-archives
(if (getenv "INSECURE")
'(("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "http://melpa.org/packages/")
("org" . "http://orgmode.org/elpa/"))
'(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")))
'(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/"))
;; I omit Marmalade because its packages are manually submitted rather
;; than pulled, so packages are often out of date with upstream.
@ -130,6 +127,16 @@ and `auto-mode-alist'.")
byte-compile-verbose doom-debug-mode
byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local))
;; accommodate INSECURE setting
(unless gnutls-verify-error
(dolist (archive package-archives)
(setcdr archive (replace-regexp-in-string "^https://" "http://" (cdr archive) t nil))))
;;
;; Startup benchmark
;;
(defun doom-packages--benchmark ()
(format "Doom loaded %s packages across %d modules in %.03fs"
;; Certainly imprecise, especially where custom additions to