]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/package.el (package-delete): Delete readme file as well.
authorTino Calancha <tino.calancha@gmail.com>
Sun, 21 May 2017 13:20:19 +0000 (22:20 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Sun, 21 May 2017 13:20:19 +0000 (22:20 +0900)
lisp/emacs-lisp/package.el

index 551f440a8f9af54bd557dfc1cb2917fa762a83df..cb8e2d60d6dee576030022c6958ddd604bfba028 100644 (file)
@@ -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)