GNU bug report logs -
#53527
29.0.50; package-reinstall fails to initialize (enough of) package.el
Previous Next
Reported by: Matt Armstrong <matt <at> rfc20.org>
Date: Tue, 25 Jan 2022 17:40:01 UTC
Severity: normal
Tags: moreinfo, patch
Found in versions 29.0.50, 28.0
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 53527 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tags 53527 + patch
quit
This is one way to fix it. Another would have been to call
`package--alist' instead of reference `package-alist' in
`package-reinstall'. ...but that wouldn't have been an optimization,
since `package-install' inevitably calls `package--archives-initialize'
anyway. This patch just makes it happen earlier.
[0001-Fix-calling-package-reinstall-just-after-quick-initi.patch (text/x-diff, inline)]
From fdf15b2985d237a70277362ad0b7d771f20c5f38 Mon Sep 17 00:00:00 2001
From: Matt Armstrong <matt <at> rfc20.org>
Date: Tue, 25 Jan 2022 11:22:10 -0800
Subject: [PATCH] Fix calling `package-reinstall' just after quick
initialization.
* lisp/emacs-lisp/package.el (package-reinstall): call
`package--archives-initialize', just like `package-install' does.
This populates `package-alist', and so fixes calling
`package-reinstall' as the first thing done after package "quick
init". (Bug#53527)
---
lisp/emacs-lisp/package.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 7679ba2fae..6a8692c983 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2379,10 +2379,14 @@ package-reinstall
"Reinstall package PKG.
PKG should be either a symbol, the package name, or a `package-desc'
object."
- (interactive (list (intern (completing-read
- "Reinstall package: "
- (mapcar #'symbol-name
- (mapcar #'car package-alist))))))
+ (interactive
+ (progn
+ (package--archives-initialize)
+ (list (intern (completing-read
+ "Reinstall package: "
+ (mapcar #'symbol-name
+ (mapcar #'car package-alist)))))))
+ (package--archives-initialize)
(package-delete
(if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
'force 'nosave)
--
2.34.1
This bug report was last modified 2 years and 280 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.