diff options
author | Philip Kaludercic <philipk@posteo.net> | 2022-10-28 20:10:30 +0200 |
---|---|---|
committer | Philip Kaludercic <philipk@posteo.net> | 2022-10-28 20:10:30 +0200 |
commit | 40977816550276aac0de75b6740fb4856e9a438b (patch) | |
tree | 09daaeb3e948e75e6d159029dc5d4608495acc07 /lisp/emacs-lisp | |
parent | 60b3eb07542ce7b9f094b40d174c07b1393d2835 (diff) | |
download | emacs-40977816550276aac0de75b6740fb4856e9a438b.tar.gz emacs-40977816550276aac0de75b6740fb4856e9a438b.tar.bz2 emacs-40977816550276aac0de75b6740fb4856e9a438b.zip |
Ensure that package specifications are always fetched
* lisp/emacs-lisp/package-vc.el (package-vc--archives-initialize): Add
new function, extending 'package--archives-initialize'.
(package-vc-install): Use new function.
(package-vc-link-directory): Use new function.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/package-vc.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index a3e7e68d5b6..5d8b2be8e97 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -451,6 +451,12 @@ the `:brach' attribute in PKG-SPEC." (package-vc-unpack-1 pkg-desc default-directory))) (package-vc-unpack-1 pkg-desc default-directory)))) +(defun package-vc--archives-initialize () + "Initialise package.el and fetch package specifications." + (package--archives-initialize) + (unless package-vc-archive-data-alist + (package-vc--download-and-read-archives))) + ;;;###autoload (defun package-vc-install (name-or-url &optional name rev backend) "Fetch the source of NAME-OR-URL. @@ -469,7 +475,7 @@ BACKEND. If missing, `package-vc-guess-backend' will be used." (progn ;; Initialize the package system to get the list of package ;; symbols for completion. - (package--archives-initialize) + (package-vc--archives-initialize) (let* ((packages (package-vc-sourced-packages-list)) (input (completing-read "Fetch package source (name or URL): " packages)) @@ -480,7 +486,7 @@ BACKEND. If missing, `package-vc-guess-backend' will be used." (cadr (assoc input package-archive-contents #'string=)) :release-rev) (user-error "No release revision was found"))))))) - (package--archives-initialize) + (package-vc--archives-initialize) (cond ((and-let* ((stringp name-or-url) (backend (or backend (package-vc-guess-backend name-or-url)))) @@ -512,7 +518,7 @@ from the base name of DIR." (file-name-base (directory-file-name dir)))))) (unless (vc-responsible-backend dir) (user-error "Directory %S is not under version control" dir)) - (package--archives-initialize) + (package-vc--archives-initialize) (let* ((name (or name (file-name-base (directory-file-name dir)))) (pkg-dir (expand-file-name name package-user-dir))) (make-symbolic-link dir pkg-dir) |