Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 6294b849 authored by myeffort's avatar myeffort

Condition in elpa install with refresh package

Added a check for new `package-archives' entries to fetch/update their
archive-contents and regenerate for new configuration of
parent 2bd1891e
......@@ -81,12 +81,24 @@ the recipe, then return nil."
"Ask elpa to install given PACKAGE."
(let* ((elpa-dir (el-get-elpa-package-directory package))
(elpa-repo (el-get-elpa-package-repo package))
;; Indicates new archive requiring to download its archive-contents
(elpa-new-repo (when (and elpa-repo)
(unless (rassoc (cdr-safe elpa-repo)
(bound-and-true-p package-archives))
;; Set `package-archive-base' to elpa-repo for old package.el
(package-archive-base (or (cdr-safe elpa-repo)
(bound-and-true-p package-archive-base)))
;; Prepend elpa-repo to `package-archives' for new package.el
(package-archives (append (when elpa-repo (list elpa-repo))
(when (boundp 'package-archives) package-archives))))
(when elpa-new-repo
(condition-case-unless-debug nil
(package--download-one-archive elpa-new-repo "archive-contents")
(error (message "Failed to download `%s' archive." (car archive))))
(unless (and elpa-dir (file-directory-p elpa-dir))
;; package-install does these only for interactive calls
(unless package--initialized
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment