[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin 7558d12 206/439: Make externals directory removal sa
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin 7558d12 206/439: Make externals directory removal safer |
Date: |
Sun, 17 Oct 2021 15:48:02 -0400 (EDT) |
branch: elpa-admin
commit 7558d1285eb1f4d71e4b5949f2f9d9caa0b3db8b
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Make externals directory removal safer
* admin/archive-contents.el (archive--find-non-trivial-file): New
function.
(archive--cleanup-packages): Check result of
archive--find-non-trivial-file before deleting untracked package.
---
admin/archive-contents.el | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index feb646a..2181aba 100755
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -589,6 +589,17 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
"Point EMACS_CLONE_REFERENCE environment variable to an "
"existing checkout.") reference)))))
+(defun archive--find-non-trivial-file (dir)
+ (catch 'found-important-file
+ (dolist (file (directory-files-recursively dir ".*"))
+ (unless (or (member file '("." ".."))
+ (string-match "\\.elc\\'" file)
+ (string-match "-autoloads.el\\'" file)
+ (string-match "-pkg.el\\'" file)
+ (file-symlink-p file))
+ (throw 'found-important-file file)))
+ nil))
+
(defun archive--cleanup-packages (externals-list)
"Remove subdirectories of `packages/' that do not correspond to known
packages.
This is any subdirectory inside `packages/' that's not under
@@ -615,8 +626,15 @@ version control nor listed in EXTERNALS-LIST."
;; Check if `dir' is under version control.
((not (zerop (call-process "git" nil nil nil
"ls-files" "--error-unmatch" dir)))
- (message "Deleted untracked package %s" dir)
- (delete-directory dir 'recursive t))))))
+ ;; Not under version control. Check if it only contains
+ ;; symlinks and generated files, in which case it is probably
+ ;; a leftover :core package that can safely be deleted.
+ (let ((file (archive--find-non-trivial-file dir)))
+ (if file
+ (message "Keeping %s for non-trivial file \"%s\"" dir file)
+ (progn
+ (message "Deleted untracked package %s" dir)
+ (delete-directory dir 'recursive t)))))))))
(defun archive--external-package-sync (name)
"Sync external package named NAME."
- [nongnu] elpa-admin 281d4aa 194/439: * GNUmakefile: Update due to a dependency change, (continued)
- [nongnu] elpa-admin 281d4aa 194/439: * GNUmakefile: Update due to a dependency change, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 4a2ebd4 186/439: Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 54886a6 199/439: Better generated HTML pages, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 83d4032 202/439: * README: Typos, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 7e4545d 200/439: * admin/archive-contents.el (archive--html-header): Use `title' for the H1., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin a30b538 216/439: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin a3dcbb3 225/439: Merge branch 'master' into new-website, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b9f2b90 208/439: * admin/archive-contents.el (archive--sync-emacs-repo): Fix thinko., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 839fe96 209/439: * GNUmakefile (check_copyrights): Skip symlinks, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin c8b582a 220/439: Merge commit '1054ea1bc5b07a1438a18c1b33f4266b28ff9d77', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 7558d12 206/439: Make externals directory removal safer,
Philip Kaludercic <=
- [nongnu] elpa-admin 5b91341 226/439: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 3fc8681 221/439: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin ff431a8 223/439: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 4fdec5b 230/439: packages/yasnippet: subtree pull from external, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 33b7bc9 236/439: Merge commit '8d07bdedfe9e56de8a32f32af6e4c853a5fa6c4d', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 0d7eb99 235/439: Add 'packages/realgud/' from commit 'b7a7fe924217931332915d457928c6851db4a636', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b2531f1 233/439: * admin/archive-contents.el: Minimal support for local externals, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin c55c928 238/439: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 8efb626 241/439: Merge commit '4d1dcdf7631c23b1259ad4f72bf9686cf95fb46c', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin c398fd6 116/439: supports web sockets, Philip Kaludercic, 2021/10/17