]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix the installation of dependencies for VC packages
authorPhilip Kaludercic <philipk@posteo.net>
Tue, 14 Feb 2023 18:48:01 +0000 (19:48 +0100)
committerPhilip Kaludercic <philipk@posteo.net>
Tue, 14 Feb 2023 18:50:01 +0000 (19:50 +0100)
* lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies):
Work with package-desc objects instead of (PACKAGE-NAME VERSION)
pairs.

lisp/emacs-lisp/package-vc.el

index bf49f274bfdf2eab525b9c4f446bf3ab1ab2b7f3..4a9870529497739648f8a8e4cd7094bc176e85dc 100644 (file)
@@ -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))