[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] elpa-admin c101039 265/357: [admin int] Add abstraction: archive-
From: |
Stefan Monnier |
Subject: |
[elpa] elpa-admin c101039 265/357: [admin int] Add abstraction: archive-call |
Date: |
Thu, 10 Dec 2020 18:06:56 -0500 (EST) |
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)
- [elpa] elpa-admin 60ab286 213/357: Squashed 'packages/gnome-c-style/' content from commit e84487c, (continued)
- [elpa] elpa-admin 60ab286 213/357: Squashed 'packages/gnome-c-style/' content from commit e84487c, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 2ba4dc8 215/357: Merge commit '6bf96861b98e91ca9c3bd146697580b42d30f5d9', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 73a80fc 227/357: Update packages/yasnippet by subtree-merging from its github-based upstream, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 3fc8681 221/357: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 2307841 196/357: * README: Expand instructions, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 5b91341 226/357: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 0b918e3 191/357: Merge ack master from github.com:leoliu/ack-el, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 8730258 240/357: Merge commit 'ab69dbcccb4d0ed5ec2a7bd6bc7b3cff7e7adbac', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 858666e 250/357: * admin/archive-contents.el: Use cl-lib, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 5d00f35 237/357: Merge commit 'a8bd8678db59322dac1015576716c4ebb2c628df', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin c101039 265/357: [admin int] Add abstraction: archive-call,
Stefan Monnier <=
- [elpa] elpa-admin a9287ff 239/357: Merge commit '48b48807a8917e455b5687945a81375703bd1a6e', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 33b7bc9 236/357: Merge commit '8d07bdedfe9e56de8a32f32af6e4c853a5fa6c4d', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 30c8a11 248/357: Merge commit '5f47b1f64cad8a06e945e2a1287b986a3676554d', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin b2531f1 233/357: * admin/archive-contents.el: Minimal support for local externals, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 8efb626 241/357: Merge commit '4d1dcdf7631c23b1259ad4f72bf9686cf95fb46c', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin c55c928 238/357: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin d5be3dd 283/357: * README: mention make check_copyrights, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin c670f77 253/357: Merge branch 'master' into new-website, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 0466964 352/357: * README.org (Adding a package): Adjust to use the new `make` targets, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 2658af9 345/357: * admin/archive-contents.el: Add preliminary code to fetch upstream updates, Stefan Monnier, 2020/12/10