From: Phillip Lord Date: Wed, 14 Sep 2016 22:20:23 +0000 (+0100) Subject: Summarization happening and some ELPA support X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8b53bb8d90cd69144746684b190c84829ab579d6;p=emacs.git Summarization happening and some ELPA support --- diff --git a/packages/GNUmakefile b/packages/GNUmakefile index e1bc6f85f96..a19d3613f1b 100644 --- a/packages/GNUmakefile +++ b/packages/GNUmakefile @@ -11,7 +11,7 @@ DIRS=$(filter-out .,$(subst ./,,$(shell find . -maxdepth 1 -type d))) ## dependent on makefile all: pkg-all $(EMACS) -check: cleanlog check-packages +check: cleanlog check-packages ert-summarize check-maybe: check-packages diff --git a/packages/admin/assess-discover.el b/packages/admin/assess-discover.el index cbbbfb31fb7..3f07575371e 100644 --- a/packages/admin/assess-discover.el +++ b/packages/admin/assess-discover.el @@ -58,6 +58,5 @@ tests directory." (defun assess-discover-run-and-exit-batch-dir (directory &optional selector) (assess-discover--load-all-tests - (concat default-directory - directory)) + (expand-file-name directory)) (ert-run-tests-batch-and-exit selector)) diff --git a/packages/admin/package-build.el b/packages/admin/package-build.el index 71897a2b0dd..48468e1b516 100644 --- a/packages/admin/package-build.el +++ b/packages/admin/package-build.el @@ -6,8 +6,8 @@ ;; So this one does the business during build (defun package-build-prepare (dir) (let ((descr - (package-desc-create :name (make-symbol dir))) - (location (package-build-dir dir))) + (package-desc-create :name (make-symbol dir))) + (location (expand-file-name dir))) (archive-refresh-pkg-file location) (setq descr (package-load-descriptor location)) (package-generate-autoloads (package-desc-name descr) location) diff --git a/packages/admin/package-makefile.el b/packages/admin/package-makefile.el index 0e42918a0d8..2f0086ba50e 100644 --- a/packages/admin/package-makefile.el +++ b/packages/admin/package-makefile.el @@ -1,65 +1,66 @@ (require 'seq) +(defvar package-makefile--elpa nil) +(defvar package-makefile--log-targets nil) +(defvar package-makefile--pkg-targets nil) + (defun package-makefile--package-dirs (directory) (directory-files directory nil "[^.].*")) (defun package-makefile--target-pkg-el (top-dir base-dir) - (format - "%s-pkg: %s/%s/%s-pkg.el + (let ((pkgfile (concat top-dir "/" base-dir "/" base-dir "-pkg.el"))) + (add-to-list + 'package-makefile--pkg-targets pkgfile) + (format + "%s-pkg: %s -%s/%s/%s-pkg.el: %s +%s: %s \t$(EMACS) --batch --directory=admin \\ \t\t--load admin/package-build.el \\ \t\t--eval '(package-build-prepare \"%s/%s\")' " - base-dir top-dir base-dir base-dir - top-dir base-dir base-dir - (mapconcat - (lambda (n) - (concat top-dir "/" base-dir "/" n)) - (seq-remove - (lambda (n) - (or - (string-match-p - ".*-autoloads.el" n) - (string-match-p - ".*-pkg.el" n))) - (directory-files - (concat top-dir "/" base-dir) - nil - ".*el$")) - " ") - top-dir base-dir)) + base-dir pkgfile + pkgfile + (mapconcat + (lambda (n) + (concat top-dir "/" base-dir "/" n)) + (seq-remove + (lambda (n) + (or + (string-match-p + ".*-autoloads.el" n) + (string-match-p + ".*-pkg.el" n))) + (directory-files + (concat top-dir "/" base-dir) + nil + ".*el$")) + " ") + top-dir base-dir))) (defun package-makefile--pkg-targets (top-dir all-dirs) - (concat - "pkg-all: " - (mapconcat - 'identity - all-dirs - "-pkg ") - "-pkg" - "\n\n" - (mapconcat - (lambda (base-dir) - (package-makefile--target-pkg-el top-dir base-dir)) - all-dirs - "\n"))) + (mapconcat + (lambda (base-dir) + (package-makefile--target-pkg-el top-dir base-dir)) + all-dirs + "\n")) (defun package-makefile--log-target (top-dir base-dir) (let* ((fulldir (concat top-dir "/" base-dir)) (filestem (concat top-dir "/" base-dir "/" base-dir)) (logfile (concat filestem ".log")) (pkgfile (concat filestem "-pkg.el"))) + (add-to-list + 'package-makefile--log-targets logfile) (format "%s: %s - @$(EMACS) --batch --load admin/assess-discover.el \\ + $(EMACS) --batch --load admin/assess-discover.el \\ --eval '(assess-discover-run-and-exit-batch-dir \"%s\")' \\ $(WRITE_LOG) %s: - test ! -f ./%s || mv ./%s ./%s~ + test ! -f %s || mv %s %s~ $(MAKE) %s WRITE_LOG= %s: %s @@ -81,32 +82,60 @@ (lambda (base-dir) (package-makefile--log-target top-dir base-dir)) all-dirs - "\n") - - " -check-packages: " + "\n"))) +(defun package-makefile--check-packages-target (targets) + (concat + "check-packages: ") (mapconcat (lambda (base-dir) (concat top-dir "/" base-dir "/" base-dir ".log")) all-dirs - " "))) + " ")) (defun package-makefile--core-packages () (package-makefile--package-dirs "core")) -(defun package-makefile--1 () - (concat - (package-makefile--pkg-targets - "core" - (package-makefile--core-packages)) - "\n" - - (package-makefile--test-targets - "core" - (package-makefile--core-packages)) - "\n")) +(defun package-makefile--elpa-dirs (elpa-package-dir) + (seq-remove + (lambda (n) + (string= "elpa.rss" n)) + (package-makefile--package-dirs elpa-package-dir))) + + +(defun package-makefile--1 () + (let ((package-makefile--log-targets nil) + (package-makefile--pkg-targets nil)) + (concat + (package-makefile--pkg-targets + "core" + (package-makefile--core-packages)) + "\n" + + (package-makefile--test-targets + "core" + (package-makefile--core-packages)) + "\n" + + (when package-makefile--elpa + (package-makefile--pkg-targets + package-makefile--elpa + (package-makefile--elpa-dirs + package-makefile-0elpa)) + "\n" + + (package-makefile--test-targets + package-makefile--elpa + (package-makefile--elpa-dirs + package-makefile--elpa))) + + "ert-summarize: " (mapconcat 'identity package-makefile--log-targets " ") + "\n\t$(EMACS) -l ert -f ert-summarize-tests-batch-and-exit $^\n\n" + + "pkg-all: " (mapconcat 'identity package-makefile--pkg-targets " ") + "\n\n" + "check-packages: " (mapconcat 'identity package-makefile--log-targets " ")))) (defun package-makefile () (with-temp-buffer diff --git a/packages/temp.el b/packages/temp.el index 47635363c37..553b1ef59c6 100644 --- a/packages/temp.el +++ b/packages/temp.el @@ -7,8 +7,3 @@ (package-makefile--makefile) (package-build-prepare "core/example") - -(package-makefile--pkg-targets - "/home/phillord/src/git/elpa-git/master/packages" - (package-makefile--package-dirs - "/home/phillord/src/git/elpa-git/master/packages"))