[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin c101039 265/439: [admin int] Add abstraction: archiv
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin c101039 265/439: [admin int] Add abstraction: archive-call |
Date: |
Sun, 17 Oct 2021 15:48:17 -0400 (EDT) |
branch: elpa-admin
commit c101039aec9471cbe4c3cbaf372e3bc8cbef14bd
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[admin int] Add abstraction: archive-call
* admin/archive-contents.el (archive-call): New func.
(archive-prepare-packages, archive--make-changelog, archive--pull)
(archive--cleanup-packages, archive--external-package-sync): Use it.
---
admin/archive-contents.el | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index 6f2fc76..6ebf5dd 100755
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -95,6 +95,11 @@ Delete backup files also."
(pp (nreverse packages) (current-buffer))
(write-region nil nil "archive-contents"))))
+(defun archive-call (destination program &rest args)
+ "Like ‘call-process’ for PROGRAM, DESTINATION, ARGS.
+The INFILE and DISPLAY arguments are fixed as nil."
+ (apply #'call-process program nil destination nil args))
+
(defconst archive--revno-re "[0-9a-f]+")
(defun archive-prepare-packages (srcdir)
@@ -113,7 +118,7 @@ Currently only refreshes the ChangeLog files."
(new-revno
(or (with-temp-buffer
(let ((default-directory srcdir))
- (call-process "git" nil '(t) nil "rev-parse" "HEAD")
+ (archive-call '(t) "git" "rev-parse" "HEAD")
(goto-char (point-min))
(when (looking-at (concat archive--revno-re "$"))
(match-string 0))))
@@ -122,7 +127,7 @@ Currently only refreshes the ChangeLog files."
(unless (equal prevno new-revno)
(with-temp-buffer
(let ((default-directory srcdir))
- (unless (zerop (call-process "git" nil '(t) nil "diff"
+ (unless (zerop (archive-call '(t) "git" "diff"
"--dirstat=cumulative,0"
prevno))
(error "Error signaled by git diff --dirstat %d" prevno)))
@@ -246,8 +251,8 @@ Rename DIR/PKG.el to PKG-VERS.el, delete DIR, and return
the descriptor."
(erase-buffer)
(let ((default-directory
(file-name-as-directory (expand-file-name dir srcdir))))
- (call-process "git" nil (current-buffer) nil
- "log" "--date=short"
+ (archive-call (current-buffer) ; hmm, why not use ‘t’ here? --ttn
+ "git" "log" "--date=short"
"--format=%cd %aN <%ae>%n%n%w(80,8,8)%B%n"
"."))
(tabify (point-min) (point-max))
@@ -602,7 +607,7 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
(expand-file-name dirname))))
(with-temp-buffer
(message "Running git pull in %S" default-directory)
- (call-process "git" nil t nil "pull")
+ (archive-call t "git" "pull")
(message "Updated %s:\n%s" dirname (buffer-string)))))
;;; Maintain external packages.
@@ -662,7 +667,7 @@ If WITH-CORE is non-nil, it means we manage :core packages
as well."
(with-temp-buffer
(let ((default-directory (file-name-as-directory
(expand-file-name dir))))
- (call-process "git" nil t nil "status" "--porcelain")
+ (archive-call t "git" "status" "--porcelain")
(buffer-string)))))
(if (zerop (length status))
(progn (delete-directory dir 'recursive t)
@@ -670,8 +675,8 @@ If WITH-CORE is non-nil, it means we manage :core packages
as well."
(message "Keeping leftover unclean %s:\n%s" dir status))))
;; Check if `dir' is under version control.
((and with-core
- (not (zerop (call-process "git" nil nil nil
- "ls-files" "--error-unmatch" dir))))
+ (not (zerop (archive-call nil "git" "ls-files"
+ "--error-unmatch" dir))))
;; 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.
@@ -691,7 +696,7 @@ If WITH-CORE is non-nil, it means we manage :core packages
as well."
(output
(with-temp-buffer
;; FIXME: Use `git worktree'!
- (call-process "git" nil t nil "clone"
+ (archive-call t "git" "clone"
"--reference" ".." "--single-branch"
"--branch" branch
archive--elpa-git-url name)
- [nongnu] elpa-admin 9c513a6 246/439: Merge commit 'db34a79efd068f28643cefd6f16a7329ba24dbf1', (continued)
- [nongnu] elpa-admin 9c513a6 246/439: Merge commit 'db34a79efd068f28643cefd6f16a7329ba24dbf1', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b14148a 249/439: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 2f122b0 251/439: Merge branch 'master' into new-website, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b9ba590 252/439: packages/yasnippet: Merge external (v0.11.0), Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin c670f77 253/439: Merge branch 'master' into new-website, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 7626ffa 254/439: Website footer improvement, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 294407d 256/439: README: Fix copyright years., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 34ecb5f 257/439: Respect .elpaignore when compiling and optimize compilation., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 82a2bda 259/439: Put tar'd files at the end to fix build in some environments., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 5660f25 261/439: [admin] Add abstraction: archive--read-externals-list, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin c101039 265/439: [admin int] Add abstraction: archive-call,
Philip Kaludercic <=
- [nongnu] elpa-admin 98bcea9 268/439: [admin int] Add abstraction: archive--dirname, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 186d10f 269/439: Clear executable bit for Emacs Lisp files., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 336afcd 272/439: Merge commit '8280df5ce6db836559a5c2442b97a2f02b6f7a05', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 9db3516 274/439: Merge branch 'scratch/org-edna', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 0f843a7 275/439: Merge branch 'scratch/dired-du', Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 94286b7 276/439: * packages/yasnippet: Merge version 0.12.0 from upstream., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 602f32e 277/439: Merge yasnippet 0.12.1 from upstream, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 5ac89c8 281/439: * packages/yasnippet: Merge version 0.12.2 from upstream., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d5be3dd 283/439: * README: mention make check_copyrights, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin d220792 286/439: Add 'packages/mmm-mode/' from commit '00c10a69c8c90178530219730ccea14ab634a74e', Philip Kaludercic, 2021/10/17