From 08212929ba7052883bd506be320dfaaae5b68970 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Sun, 21 May 2017 22:20:19 +0900 Subject: [PATCH] * lisp/emacs-lisp/package.el (package-delete): Delete readme file as well. --- lisp/emacs-lisp/package.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 551f440a8f9..cb8e2d60d6d 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2128,10 +2128,15 @@ If NOSAVE is non-nil, the package is not removed from (t (add-hook 'post-command-hook #'package-menu--post-refresh) (delete-directory dir t t) - ;; Remove NAME-VERSION.signed file. - (let ((signed-file (concat dir ".signed"))) - (if (file-exists-p signed-file) - (delete-file signed-file))) + ;; Remove NAME-VERSION.signed and NAME-readme.txt files. + (dolist (suffix '(".signed" "readme.txt")) + (let* ((version (package-version-join (package-desc-version pkg-desc))) + (file (concat (if (string= suffix ".signed") + dir + (substring dir 0 (- (length version)))) + suffix))) + (when (file-exists-p file) + (delete-file file)))) ;; Update package-alist. (let ((pkgs (assq name package-alist))) (delete pkg-desc pkgs) -- 2.39.2