1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

emacs-lisp/package.el (package-reinstall): Accept package-desc objects.

This commit is contained in:
Artur Malabarba 2015-02-04 15:17:06 +00:00
parent 5687ac9f01
commit 102a21d689
2 changed files with 7 additions and 2 deletions

View File

@ -7,6 +7,7 @@
selected. When given a package-desc object which is already
installed, the package is not downloaded again, but it is marked
as selected (if it wasn't already).
(package-reinstall): Accept package-desc objects.
2015-02-03 Artur Malabarba <bruce.connor.am@gmail.com>

View File

@ -1265,12 +1265,16 @@ to install it but still mark it as selected."
;;;###autoload
(defun package-reinstall (pkg)
"Reinstall package PKG."
"Reinstall package PKG.
PKG shoul 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))))))
(package-delete (cadr (assq pkg package-alist)) 'force 'nosave)
(package-delete
(if (package-desc-p pkg) pkg (cadr (assq pkg package-alist)))
'force 'nosave)
(package-install pkg))
(defun package-strip-rcs-id (str)