[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] elpa-admin 311d819 357/357: * GNUmakefile: Fix `-l` args to `emac
From: |
Stefan Monnier |
Subject: |
[elpa] elpa-admin 311d819 357/357: * GNUmakefile: Fix `-l` args to `emacs` which require an actual file name |
Date: |
Thu, 10 Dec 2020 18:07:14 -0500 (EST) |
branch: elpa-admin
commit 311d8196e7823fad6f82e3b195297f097c07df7f
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* GNUmakefile: Fix `-l` args to `emacs` which require an actual file name
(check/%): Add per-package copyright check.
(TOP): Delete variable.
($(1)-test): Use $CURDIR instead,
* elpa-admin.el (elpaa--html-make-pkg): Make `srcdir` non-optional.
(elpaa-batch-html-make-index): Delete function.
(elpaa-ert-package-install): Adjust dir name for new layout.
---
GNUmakefile | 52 ++++++++++++++++++++++++++++++++++++----------------
elpa-admin.el | 47 ++---------------------------------------------
2 files changed, 38 insertions(+), 61 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile
index 7474c71..db1636c 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -28,12 +28,31 @@ check_copyrights:
done) | sort >$(CR_EXCEPTIONS)~
diff -u "$(CR_EXCEPTIONS)" "$(CR_EXCEPTIONS)~"
+.PHONY: check/%
+check/%:
+ @export LC_ALL=C; \
+ (cd packages && \
+ find ./$* -name '.git' -prune -o \
+ -name 'test' -prune -o \
+ -name '*.el' -print0 | \
+ xargs -0 grep -L 'Free Software Foundation, Inc' | \
+ grep -v '\(\.dir-locals\|.-\(pkg\|autoloads\)\)\.el$$'; \
+ find ./$* -name '.git' -prune -o -name '*.el' -type f -print | \
+ while read f; do \
+ fquoted="$$(echo $$f|tr '|' '_')"; \
+ sed -n -e '/[Cc]opyright.*, *[1-9][-0-9]*,\?$$/N' \
+ -e '/Free Software Foundation/d' \
+ -e "s|^\\(.*;.*[Cc]opyright\\)|$$fquoted:\\1|p" \
+ "$$f"; \
+ done; \
+ cat ../$(CR_EXCEPTIONS) ../$(CR_EXCEPTIONS)) | sort | uniq -u
+
build/%:
- $(EMACS) -l $(CURDIR)/admin/elpa-admin \
+ $(EMACS) -l $(CURDIR)/admin/elpa-admin.el \
-f elpaa-batch-make-one-package $*
build-all:
- $(EMACS) -l $(CURDIR)/admin/elpa-admin \
+ $(EMACS) -l $(CURDIR)/admin/elpa-admin.el \
-f elpaa-batch-make-all-packages
## Deploy the package archive to archive/, with packages in
@@ -58,7 +77,7 @@ process-archive:
# rules like "%.tar: ../%/ChangeLog" so we only rebuild the packages
# that have indeed changed.
cd $(ARCHIVE_TMP)/packages && \
- $(EMACS) -l $(CURDIR)/admin/elpa-admin \
+ $(EMACS) -l $(CURDIR)/admin/elpa-admin.el \
-f elpaa-batch-make-archive
@cd $(ARCHIVE_TMP)/packages && \
for pt in *; do \
@@ -148,7 +167,7 @@ $(foreach al, $(autoloads), $(eval $(call RULE-srcdeps,
$(al))))
%-autoloads.el:
@#echo 'Generating autoloads for $@'
@cd $(dir $@) && \
- $(EMACS) -l $(CURDIR)/admin/elpa-admin \
+ $(EMACS) -l $(CURDIR)/admin/elpa-admin.el \
--eval "(require 'package)" \
--eval "(load (expand-file-name \"../names/names-autoloads.el\")
t t)" \
--eval "(package-generate-autoloads \"$$(basename $$(pwd))\" \
@@ -200,7 +219,7 @@ pkg_descs:=$(foreach pkg, $(pkgs), $(pkg)/$(notdir
$(pkg))-pkg.el)
#$(foreach al, $(single_pkgs), $(eval $(call RULE-srcdeps, $(al))))
%-pkg.el: %.el
@echo 'Generating description file $@'
- @$(EMACS) -l admin/elpa-admin \
+ @$(EMACS) -l admin/elpa-admin.el \
-f elpaa-batch-generate-description-file "$@"
.PHONY: all-in-place
@@ -210,6 +229,9 @@ all-in-place: | $(extra_elcs) $(autoloads) $(pkg_descs) elcs
#### `make package/<pkgname>` to compile the files of a single package ####
+# FIXME: `make` spends a lot of time at startup now, apparently
+# building all those singlepkg rules!
+
define RULE-singlepkg
$(filter $(1)/%, $(elcs)): $1/$(notdir $(1))-pkg.el \
$1/$(notdir $(1))-autoloads.el
@@ -226,7 +248,7 @@ MISSING_script := (sed -ne
's|^.("\([^"]*\)".*|packages/\1|p' externals-list; \
MISSING_PKGS := $(shell $(MISSING_script))
$(MISSING_PKGS):
- $(EMACS) -l admin/elpa-admin \
+ $(EMACS) -l admin/elpa-admin.el \
-f elpaa-batch-archive-update-worktrees "$(@F)"
@@ -234,19 +256,19 @@ $(MISSING_PKGS):
.PHONY: fetch/%
fetch/%:
- $(EMACS) -l admin/elpa-admin -f elpaa-batch-fetch-and-show "$*"
+ $(EMACS) -l admin/elpa-admin.el -f elpaa-batch-fetch-and-show "$*"
.PHONY: fetch-all
fetch-all:
- $(EMACS) -l admin/elpa-admin -f elpaa-batch-fetch-and-show "-"
+ $(EMACS) -l admin/elpa-admin.el -f elpaa-batch-fetch-and-show "-"
.PHONY: sync/%
sync/%:
- $(EMACS) -l admin/elpa-admin -f elpaa-batch-fetch-and-push "$*"
+ $(EMACS) -l admin/elpa-admin.el -f elpaa-batch-fetch-and-push "$*"
.PHONY: sync-all
sync-all:
- $(EMACS) -l admin/elpa-admin -f elpaa-batch-fetch-and-push "-"
+ $(EMACS) -l admin/elpa-admin.el -f elpaa-batch-fetch-and-push "-"
@@ -254,7 +276,7 @@ sync-all:
.PHONY:
externals:
- $(EMACS) -l admin/elpa-admin \
+ $(EMACS) -l admin/elpa-admin.el \
-f elpaa-add/remove/update-externals
@@ -263,13 +285,11 @@ externals:
PACKAGE_DIRS = $(shell find packages -maxdepth 1 -type d)
PACKAGES=$(subst /,,$(subst packages,,$(PACKAGE_DIRS)))
-TOP =$(shell pwd)
-
define test_template
$(1)-test:
- cd packages/$(1); \
- $(EMACS) -l $(TOP)/admin/elpa-admin.el \
- --eval "(elpaa-ert-test-package \"$(TOP)\" '$(1))" \
+ cd packages/$(1); \
+ $(EMACS) -l $(CURDIR)/admin/elpa-admin.el.el \
+ --eval "(elpaa-ert-test-package \"$(CURDIR)\" '$(1))" \
$(1)-test-log:
$(MAKE) $(1)-test > packages/$(1)/$(1).log 2>&1 || { stat=ERROR; }
diff --git a/elpa-admin.el b/elpa-admin.el
index b4b5e34..97cbe12 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -28,7 +28,6 @@
;; - Fix archive name and URL
;; TODO:
-;; - Eliminate hardcoded `build/packages' directory structure
;; - support for rebuilding index.html, archive-contents, and <pkg>.html
;; - support for building the Info files
;; - support for README.md for some packages
@@ -788,11 +787,9 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
(concat git-sv (nth 1 urls))
'Gitweb))))
-(defun elpaa--html-make-pkg (pkg pkg-spec files &optional srcdir)
+(defun elpaa--html-make-pkg (pkg pkg-spec files srcdir)
(let* ((name (symbol-name (car pkg)))
(latest (package-version-join (aref (cdr pkg) 0)))
- (srcdir (or srcdir
- (expand-file-name name "../../build/packages")))
(mainsrcfile (expand-file-name (format "%s.el" name) srcdir))
(desc (aref (cdr pkg) 2)))
(cl-assert (equal name (car pkg-spec)))
@@ -892,46 +889,6 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
</body>\n")
(write-region (point-min) (point-max) "index.html")))
-(defun elpaa-batch-html-make-index ()
- (let ((packages (make-hash-table :test #'equal))
- (specs (elpaa--form-from-file-contents "externals-list"))
- (archive-contents
- ;; Skip the first element which is a version number.
- (cdr (elpaa--form-from-file-contents "archive-contents"))))
- (dolist (subdir (directory-files "../../build/packages" nil))
- (cond
- ((member subdir '("." ".." "elpa.rss" "index.html" "archive-contents")))
- (t (puthash subdir nil packages))))
- (dolist (file (directory-files default-directory nil))
- (cond
- ((member file '("." ".." "elpa.rss" "index.html" "archive-contents")))
- ((string-match "\\.html\\'" file))
- ((string-match "\\.sig\\'" file))
- ((string-match "-readme\\.txt\\'" file)
- (let ((name (substring file 0 (match-beginning 0))))
- (puthash name (gethash name packages) packages)))
- ((string-match "-\\([0-9][^-]*\\)\\.\\(tar\\|el\\)\\'" file)
- (let ((name (substring file 0 (match-beginning 0)))
- (version (match-string 1 file)))
- (push (cons version file) (gethash name packages))))
- (t (message "Unknown file %S" file))))
- (maphash (lambda (pkg-name files)
- (elpaa--html-make-pkg
- (let ((pkg (intern pkg-name)))
- (or (assq pkg archive-contents)
- ;; Add entries for packages that are either not yet
- ;; released or not released any more.
- ;; FIXME: Get actual description!
- (let ((entry (cons pkg (vector nil nil "" nil nil))))
- (setq archive-contents
- ;; Add entry at the end.
- (nconc archive-contents (list entry)))
- entry)))
- (assoc pkg-name specs)
- files))
- packages)
- (elpaa--html-make-index archive-contents)))
-
(defun elpaa--pull (dirname)
(let ((default-directory (elpaa--dirname dirname)))
(with-temp-buffer
@@ -1281,7 +1238,7 @@ If WITH-CORE is non-nil, it means we manage :core
packages as well."
;; blitz default value and set up from elpa.
(setq package-archives
`(("local-elpa"
- . ,(expand-file-name "archive/packages" top-directory)))
+ . ,(expand-file-name "packages" top-directory)))
package-user-dir (make-temp-file "elpa-test" t))
(package-initialize)
(package-refresh-contents)
- [elpa] elpa-admin 0f843a7 275/357: Merge branch 'scratch/dired-du', (continued)
- [elpa] elpa-admin 0f843a7 275/357: Merge branch 'scratch/dired-du', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin d4f5903 284/357: * README: Clarify the right fix for check_copyrights failure, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin c60a3bb 280/357: Merge branch 'scratch/which-key', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin f85cb8d 302/357: * README (PACKAGES/Externals): Clarify use, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 26a2da8 312/357: More specific externals example., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 55ff372 317/357: * admin/archive-contents.el: Improve package HTML headers, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin c90458f 329/357: Add lang attributes to the html tag, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin cdef4ce 338/357: * admin/archive-contents.el: Add preliminary support for the NonGNU archive, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 60ecd84 351/357: * admin/archive-contents.el: Fix construction of index.html, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 39eb0cf 343/357: * admin/archive-contents.el (batch-generate-description-file): New function, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 311d819 357/357: * GNUmakefile: Fix `-l` args to `emacs` which require an actual file name,
Stefan Monnier <=
- [elpa] elpa-admin ac1e1e9 198/357: README: Fix typos., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 9db3516 274/357: Merge branch 'scratch/org-edna', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin cb72492 279/357: Merge branch 'ebdb-bits', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 7e4545d 200/357: * admin/archive-contents.el (archive--html-header): Use `title' for the H1., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 49382d4 067/357: Some tweaks to README, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin e38e391 108/357: Use lm-keywords-list instead of split-string for archive contents., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin a73fa6a 113/357: update link in README, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin a0bc800 185/357: Squashed 'packages/pinentry/' content from commit 075deb6, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 98bcea9 268/357: [admin int] Add abstraction: archive--dirname, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin e2b9274 266/357: [admin int] Simplify ‘archive--write-pkg-file’ calling convention., Stefan Monnier, 2020/12/10