emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/package-vc-fixes c383864f96 46/48: Have 'package-delete' handle


From: Philip Kaludercic
Subject: scratch/package-vc-fixes c383864f96 46/48: Have 'package-delete' handle symlinked packages correctly
Date: Wed, 16 Nov 2022 04:50:11 -0500 (EST)

branch: scratch/package-vc-fixes
commit c383864f96ab97889b734300153057b774931f4f
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Have 'package-delete' handle symlinked packages correctly
    
    * lisp/emacs-lisp/package.el (package--delete-directory): Check if a
    directory is a symbolic link.
---
 lisp/emacs-lisp/package.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index aafb0e503d..f3d26ebeda 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2448,7 +2448,9 @@ compiled."
     (cl-loop
      for file in (directory-files-recursively dir "\\.el\\'")
      do (comp-clean-up-stale-eln (comp-el-to-eln-filename file))))
-  (delete-directory dir t))
+  (if (file-symlink-p (directory-file-name dir))
+      (delete-file (directory-file-name dir))
+    (delete-directory dir t)))
 
 
 (defun package-delete (pkg-desc &optional force nosave)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]