]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure right package-desc-type before installing package
authorPhilip Kaludercic <philipk@posteo.net>
Wed, 22 Feb 2023 14:23:43 +0000 (15:23 +0100)
committerPhilip Kaludercic <philipk@posteo.net>
Fri, 24 Feb 2023 16:14:19 +0000 (17:14 +0100)
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Move copying
code from 'package-vc-install'.
(package-vc-install): Remove copying.  (Bug#61669)

lisp/emacs-lisp/package-vc.el

index b753adcb8a091451698ec1bbd143a64c3b5d94e1..b22823fd70680d2389bf9f3939ed2d3d380d5335 100644 (file)
@@ -615,6 +615,10 @@ PKG-SPEC is a package specification, a property list describing
 how to fetch and build the package.  See `package-vc--archive-spec-alist'
 for details.  The optional argument REV specifies a specific revision to
 checkout.  This overrides the `:branch' attribute in PKG-SPEC."
+  (unless (eq (package-desc-kind pkg-desc) 'vc)
+    (let ((copy (copy-package-desc pkg-desc)))
+      (setf (package-desc-kind copy) 'vc
+            pkg-desc copy)))
   (pcase-let* (((map :lisp-dir) pkg-spec)
                (name (package-desc-name pkg-desc))
                (dirname (package-desc-full-name pkg-desc))
@@ -826,9 +830,7 @@ regular package, but it will not remove a VC package.
        rev)))
    ((and-let* ((desc (assoc package package-archive-contents #'string=)))
       (package-vc--unpack
-       (let ((copy (copy-package-desc (cadr desc))))
-         (setf (package-desc-kind copy) 'vc)
-         copy)
+       (cadr desc)
        (or (package-vc--desc->spec (cadr desc))
            (and-let* ((extras (package-desc-extras (cadr desc)))
                       (url (alist-get :url extras))