branch: elpa-admin commit 802b866b7cddebe0a11ad9b565d77421ff210d92 Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
* GNUmakefile (sync-some): New target * elpa-admin.el (elpaa--batch-fetch-and): Allow iterating over subset --- GNUmakefile | 9 +++++++-- elpa-admin.el | 11 ++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 9dda824..291b0ec 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -269,7 +269,7 @@ fetch/%: .PHONY: fetch-all fetch-all: - $(EMACS) -l admin/elpa-admin.el -f elpaa-batch-fetch-and-show "-" + $(EMACS) -l admin/elpa-admin.el -f elpaa-batch-fetch-and-show : .PHONY: sync/% sync/%: @@ -277,7 +277,12 @@ sync/%: .PHONY: sync-all sync-all: - $(EMACS) -l admin/elpa-admin.el -f elpaa-batch-fetch-and-push "-" + $(EMACS) -l admin/elpa-admin.el -f elpaa-batch-fetch-and-push : + +# Only sync those packages which enable the `:auto-sync` property. +.PHONY: sync-some +sync-some: + $(EMACS) -l admin/elpa-admin.el -f elpaa-batch-fetch-and-push :auto-sync diff --git a/elpa-admin.el b/elpa-admin.el index 53ecc99..551134b 100644 --- a/elpa-admin.el +++ b/elpa-admin.el @@ -1584,16 +1584,17 @@ More at " (elpaa--default-url pkgname)) (defun elpaa--batch-fetch-and (k) (let ((specs (elpaa--get-specs)) (pkgs command-line-args-left) - (clal command-line-args-left)) + (condition ':)) (setq command-line-args-left nil) - (if (member pkgs '(("-") ("?"))) (setq pkgs (mapcar #'car specs))) + (when (and (null (cdr pkgs)) (string-match "\\`:" (car pkgs))) + (setq condition (intern (car pkgs))) + (setq pkgs (mapcar #'car specs))) (dolist (pkg pkgs) (let* ((pkg-spec (assoc pkg specs))) (cond ((not pkg-spec) (message "Unknown package: %s" pkg)) - ((and (equal clal '("?")) (not (elpaa--spec-get pkg-spec :auto-sync))) - nil) - (t + ((or (eq condition ':) + (elpaa--spec-get pkg-spec condition)) ;; (unless (file-directory-p (expand-file-name pkg "packages")) ;; (elpaa--worktree-sync pkg-spec)) (elpaa--fetch pkg-spec k)))))))