From: Philip Kaludercic Date: Tue, 14 Feb 2023 18:48:01 +0000 (+0100) Subject: ; Fix the installation of dependencies for VC packages X-Git-Tag: emacs-29.0.90~426^2~23 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6a32ba8b69c9d7a9c356611bb8033a0a83b4e8b8;p=emacs.git ; Fix the installation of dependencies for VC packages * lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies): Work with package-desc objects instead of (PACKAGE-NAME VERSION) pairs. --- diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index bf49f274bfd..4a987052949 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -435,24 +435,29 @@ version of that package." (push pkg missing)))))) (version-order (a b) "Predicate to sort packages in order." - (version-list-< (cadr b) (cadr a))) + (version-list-< + (package-desc-version b) + (package-desc-version a))) (duplicate-p (a b) "Are A and B the same package?" - (eq (car a) (car b))) + (equal a (car b))) (depends-on-p (target package) "Does PACKAGE depend on TARGET?" (or (eq target package) (let* ((pac package-archive-contents) (desc (cadr (assoc package pac)))) - (seq-some - (apply-partially #'depends-on-p target) - (package-desc-reqs desc))))) + (and desc (seq-some + (apply-partially #'depends-on-p target) + (package-desc-reqs desc)))))) (dependent-order (a b) - (or (not (depends-on-p (car b) (car a))) - (depends-on-p (car a) (car b))))) + (let ((desc-a (package-desc-name a)) + (desc-b (package-desc-name b))) + (or (not desc-a) (not desc-b) + (not (depends-on-p desc-b desc-a)) + (depends-on-p desc-a desc-b))))) (mapc #'search requirements) (cl-callf sort to-install #'version-order) - (cl-callf seq-uniq to-install #'duplicate-p) + (cl-callf seq-uniq to-install) (cl-callf sort to-install #'dependent-order)) (mapc #'package-install-from-archive to-install) missing))