[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin b776ff9 408/439: * elpa-admin.el (elpaa--prune-old-t
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin b776ff9 408/439: * elpa-admin.el (elpaa--prune-old-tarballs): Move the .sig files as well |
Date: |
Sun, 17 Oct 2021 15:48:46 -0400 (EDT) |
branch: elpa-admin
commit b776ff998db382bde8b244e06304d1b620fd8829
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* elpa-admin.el (elpaa--prune-old-tarballs): Move the .sig files as well
Also fix use of destructively-modified list and demote errors.
---
elpa-admin.el | 60 +++++++++++++++++++++++++++++++++++------------------------
1 file changed, 36 insertions(+), 24 deletions(-)
diff --git a/elpa-admin.el b/elpa-admin.el
index b56bc48..4501ba5 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -424,30 +424,42 @@ Do it without leaving the current branch."
(let ((self (rassoc (file-name-nondirectory tarball) oldtarballs)))
(when self
(setq oldtarballs (delq self oldtarballs))))
- (when (nthcdr elpaa--keep-max oldtarballs)
- (let* ((keep (elpaa--keep-old oldtarballs elpaa--keep-max))
- (skeep (nreverse (sort keep
- (lambda (t1 t2) (version<= (car t1) (car
t2)))))))
- (message "Keeping: %s" (mapcar #'cdr skeep))
- (dolist (oldtarball oldtarballs)
- (unless (memq oldtarball keep)
- (cl-assert (not (equal (cdr oldtarball)
- (file-name-nondirectory tarball))))
- (message "Deleting %s" (cdr oldtarball))
- (let ((oldd (expand-file-name "old" destdir)))
- (make-directory oldd t)
- (rename-file (expand-file-name (cdr oldtarball) destdir)
- (expand-file-name (cdr oldtarball) oldd)))))
- (setq oldtarballs skeep)))
- (dolist (oldtarball oldtarballs)
- ;; Compress oldtarballs.
- (let ((file (cdr oldtarball)))
- (when (string-match "\\.\\(tar\\|el\\)\\'" file)
- ;; Make sure we don't compress the file we just created.
- (cl-assert (not (equal file (file-name-nondirectory tarball))))
- ;; (elpaa--message "not equal %s and %s" file tarball)
- (elpaa--call nil "lzip" (expand-file-name file destdir))
- (setf (cdr oldtarball) (concat file ".lz")))))
+ (with-demoted-errors "elpaa--prune-old-tarballs: %S"
+ (when (nthcdr elpaa--keep-max oldtarballs)
+ (let* ((keep (elpaa--keep-old oldtarballs elpaa--keep-max))
+ (keep (nreverse (sort keep
+ (lambda (t1 t2) (version<= (car t1) (car
t2)))))))
+ (message "Keeping: %s" (mapcar #'cdr keep))
+ (dolist (oldtarball oldtarballs)
+ (unless (memq oldtarball keep)
+ (cl-assert (not (equal (cdr oldtarball)
+ (file-name-nondirectory tarball))))
+ (message "Deleting %s" (cdr oldtarball))
+ (let* ((olddir (expand-file-name "old" destdir))
+ (filename (cdr oldtarball))
+ (basename (file-name-sans-extension filename))
+ (sig (concat (if (member (file-name-extension filename)
+ '("lz" "gz"))
+ (file-name-sans-extension basename)
+ basename)
+ ".sig"))
+ (mvfun (lambda (f)
+ (let ((src (expand-file-name f destdir)))
+ (when (file-exists-p src)
+ (rename-file src (expand-file-name
olddir)))))))
+ (make-directory olddir t)
+ (funcall mvfun filename)
+ (funcall mvfun sig))))
+ (setq oldtarballs keep)))
+ (dolist (oldtarball oldtarballs)
+ ;; Compress oldtarballs.
+ (let ((file (cdr oldtarball)))
+ (when (string-match "\\.\\(tar\\|el\\)\\'" file)
+ ;; Make sure we don't compress the file we just created.
+ (cl-assert (not (equal file (file-name-nondirectory tarball))))
+ ;; (elpaa--message "not equal %s and %s" file tarball)
+ (elpaa--call nil "lzip" (expand-file-name file destdir))
+ (setf (cdr oldtarball) (concat file ".lz"))))))
oldtarballs)
(defun elpaa--make-one-tarball ( tarball dir pkg-spec metadata
- [nongnu] elpa-admin bcacdba 361/439: * elpa-admin.el: Add `:readme` and `:news` properties to specifications, (continued)
- [nongnu] elpa-admin bcacdba 361/439: * elpa-admin.el: Add `:readme` and `:news` properties to specifications, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 311d819 357/439: * GNUmakefile: Fix `-l` args to `emacs` which require an actual file name, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 802b866 394/439: * GNUmakefile (sync-some): New target, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b3e663b 353/439: Rename ELisp files, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 4b508ad 364/439: * elpa-admin.el: Allow site-local config, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 48e4ccf 388/439: * elpa-admin.el: Don't pass non-existing dirs to `bwrap`, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 12cd68f 386/439: * README.org: Update according to comments from RMS., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d56a357 416/439: * elpa-admin.el: Don't hide the log of diverged packages in `fetch/<pkg>`, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin e79cce6 382/439: * elpa-admin.el (elpaa--get-section): Fix fetching from main file, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 2b93ca3 363/439: * elpa-admin.el: Add support for building Texi from Org., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b776ff9 408/439: * elpa-admin.el (elpaa--prune-old-tarballs): Move the .sig files as well,
Philip Kaludercic <=
- [nongnu] elpa-admin 911fbf6 370/439: * GNUmakefile: Try and unbreak "make packages/foo". Still not perfect, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin bdb17b6 409/439: * elpa-admin.el (elpaa--get-devel-version): Don't remove *all* zeroes!, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 0fe87ad 380/439: * elpa-admin.el (elpaa--release-email): Usual last minute typo, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 1ee6e0e 383/439: * elpa-admin.el (elpaa--get-section): Use the whole section, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 68c0d47 414/439: * elpa-admin.el (elpaa--fetch): Don't show the log if branches diverged, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 54ca8ea 415/439: * elpa-admin.el: Don't build release tarballs for pre-release versions, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin fd42057 422/439: Prefer HTTPS to HTTP, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 28b66f7 427/439: * elpa-admin.el (elpaa--get-last-release): Don't return snapshot versions, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 069c128 429/439: Allow testing locally via list-packages, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 6afe3b7 431/439: * elpa-admin.el (elpaa--make-one-tarball): Be a bit more verbose, Philip Kaludercic, 2021/10/17