branch: elpa-admin
commit 7a4ef58ff89a8ae02d1327b96556cf50531b87f5
Author: Stefan Monnier <[email protected]>
Commit: Stefan Monnier <[email protected]>
Add separate rule to rebuild the index.html files
* GNUmakefile (archiv%/index.html): New rule.
* elpa-admin.el (elpaa-batch-html-make-index): New function.
---
GNUmakefile | 7 +++++++
elpa-admin.el | 8 ++++++++
2 files changed, 15 insertions(+)
diff --git a/GNUmakefile b/GNUmakefile
index 4b2665a247..88486e8b87 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -49,6 +49,13 @@ readme:
(find-file \"README\")\
(org-export-to-file 'html \"html/readme.html\"))"
+########## Updating specific files ############################################
+
+# Apparently `%` can't match the empty string!
+archiv%/index.html: archiv%/archive-contents
+ $(EMACS) -l admin/elpa-admin.el \
+ -f elpaa-batch-html-make-index $< $*
+
########## Rules for in-place installation ####################################
pkgs := $(wildcard packages/*)
diff --git a/elpa-admin.el b/elpa-admin.el
index 2ebebe85a5..fff9fd9f7f 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -1971,6 +1971,14 @@ arbitrary code."
(insert (elpaa--html-footer))
(write-region (point-min) (point-max) "index.html")))
+(defun elpaa-batch-html-make-index ()
+ (let* ((ac-file (pop command-line-args-left))
+ (elpaa--name (concat elpaa--name
+ (substring (pop command-line-args-left) 1)))
+ (ac (elpaa--form-from-file-contents ac-file))
+ (default-directory (file-name-directory (expand-file-name ac-file))))
+ (elpaa--html-make-index (cdr ac))))
+
(defun elpaa--pull (dirname)
(let ((default-directory (elpaa--dirname dirname)))
(with-temp-buffer