summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2022-11-15 14:36:26 +0100
committerPhilip Kaludercic <philipk@posteo.net>2022-11-17 20:55:04 +0100
commit228c247e6ff79b5aeb4cf65911fdea60d1f8edcf (patch)
tree0a38ee51a3307f0ddfb8bd9136edf05ae66a1886
parent32f51f17c425baf6e816a51f0823d58ef79f3d3d (diff)
downloademacs-228c247e6ff79b5aeb4cf65911fdea60d1f8edcf.tar.gz
emacs-228c247e6ff79b5aeb4cf65911fdea60d1f8edcf.tar.bz2
emacs-228c247e6ff79b5aeb4cf65911fdea60d1f8edcf.zip
Remove duplicate package descriptions after updating
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): Ensure there is always just one instance of a package description in 'package-alist'.
-rw-r--r--lisp/emacs-lisp/package-vc.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index bf8deb20244..368667814c4 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -386,6 +386,11 @@ This includes downloading missing dependencies, generating
autoloads, generating a package description file (used to
identify a package as a source package later on), building
documentation and marking the package as installed."
+ ;; Remove any previous instance of PKG-DESC from `package-alist'
+ (let ((pkgs (assq (package-desc-name pkg-desc) package-alist)))
+ (when pkgs
+ (setf (cdr pkgs) (delq pkg-desc (cdr pkgs)))))
+
;; In case the package was installed directly from source, the
;; dependency list wasn't know beforehand, and they might have
;; to be installed explicitly.