Subject: [PATCH] Upgrade out-of-date dependencies with package-vc
From: Joseph Turner <[email-masked]>
To: [email-masked]
Date: Sun, 13 Oct 2024 01:23:38 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

I noticed this bug when working on hyperdrive.el, which I had installed
with package-vc-install-from-checkout.  I updated the version of its
transient.el dependency in the Package-Requires header and attempted to
reinstall, but it did not attempt to update the dependency.

I think the attached patch may not be the whole solution.  I applied it,
attempted package-vc-install-from-checkout again, and got this error:

package--with-response-buffer-1: https://melpa.org/packages/transient-20241004.1739.tar: Not found

Do we need to call package-refresh-contents at some point inside of
package-vc-install-dependencies?

Thank you!

Joseph

From fd05beab4903e3ba9f2a6866a00e924f8bcd5637 Mon Sep 17 00:00:00 2001
From: Joseph Turner <[email-masked]>
Date: Sun, 13 Oct 2024 01:10:02 +0200
Subject: [PATCH] Upgrade out-of-date dependencies

* lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies): Pass
the specified package version when checking if a package is installed.
---
 lisp/emacs-lisp/package-vc.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index e168096e153..58916637008 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -465,7 +465,7 @@ package-vc-install-dependencies
                   "Attempt to find all dependencies for PKG."
                   (cond
                    ((assq (car pkg) to-install)) ;inhibit cycles
-                   ((package-installed-p (car pkg)))
+                   ((package-installed-p (car pkg) (cadr pkg)))
                    ((let* ((pac package-archive-contents)
                            (desc (cadr (assoc (car pkg) pac))))
                       (if desc
-- 
2.46.0