]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Clean-up all .eln dirs.
authorAndrea Corallo <akrl@sdf.org>
Sun, 21 Mar 2021 08:15:25 +0000 (09:15 +0100)
committerAndrea Corallo <akrl@sdf.org>
Sun, 21 Mar 2021 08:15:25 +0000 (09:15 +0100)
lisp/emacs-lisp/comp.el

index 6da1a7979c3721df926f77650c3e91b6f43012bd..ca4be0fe9767c89f4a42c71fb5521b6bd85c6c6a 100644 (file)
@@ -3776,11 +3776,14 @@ sharing the original source filename (including FILE)."
      with filename-hash = (match-string 1 file)
      with regexp = (rx-to-string
                     `(seq "-" ,filename-hash "-" (1+ hex) ".eln" eos))
-     for dir in (butlast (comp-eln-load-path-eff)) ; Skip last dir.
+     for dir in (comp-eln-load-path-eff)
      do (cl-loop
          for f in (when (file-exists-p dir)
                    (directory-files dir t regexp t))
-         do (comp-delete-or-replace-file f)))))
+         ;; We may not be able to delete de file if we have no write
+         ;; permisison.
+         do (ignore-error file-error
+              (comp-delete-or-replace-file f))))))
 
 (defun comp-delete-or-replace-file (oldfile &optional newfile)
   "Replace OLDFILE with NEWFILE.