Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit ab0e7435 authored by Dimitri Fontaine's avatar Dimitri Fontaine

Per comment and experimentations from DarwinAwardWinner, cleanup `el-get-rmdir'.

The new implementation no longer depends on the :type property of the
package, meaning that you can actually `el-get-remove' a package whose type
changed in its recipe.
parent 9b5ed136
...@@ -94,21 +94,15 @@ entry." ...@@ -94,21 +94,15 @@ entry."
;; ;;
;; Common support bits ;; Common support bits
;; ;;
(defun el-get-rmdir (package url post-remove-fun) (defun el-get-rmdir (package &rest ignored)
"Just rm -rf the package directory. Follow symlinks." "Just rm -rf the package directory. If it is a symlink, delete it."
(let* ((source (el-get-package-def package)) (let* ((pdir (el-get-package-directory package)))
(method (el-get-package-method source)) (cond ((file-symlink-p pdir)
(pdir (el-get-package-directory package))) (delete-file pdir))
(if (eq method 'elpa) ((file-directory-p pdir)
;; only remove a symlink here (delete-directory pdir 'recursive))
(when (or (file-symlink-p (directory-file-name pdir)) ((file-exists-p pdir)
(file-exists-p pdir)) (delete-file pdir)))))
(delete-file (directory-file-name pdir)))
;; non ELPA packages, remove the directory
(if (file-exists-p pdir)
(dired-delete-file pdir 'always)
(message "el-get could not find package directory \"%s\"" pdir))
(funcall post-remove-fun package))))
;; ;;
...@@ -400,4 +394,3 @@ out if it's nil." ...@@ -400,4 +394,3 @@ out if it's nil."
command))))) command)))))
(provide 'el-get-core) (provide 'el-get-core)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment