[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] elpa-admin 90851ae 086/357: Get "make -k" to go through
From: |
Stefan Monnier |
Subject: |
[elpa] elpa-admin 90851ae 086/357: Get "make -k" to go through |
Date: |
Thu, 10 Dec 2020 18:06:20 -0500 (EST) |
branch: elpa-admin
commit 90851ae76500941e5fc1b5c6c1be50d85dadb798
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Get "make -k" to go through
---
GNUmakefile | 26 ++------
admin/archive-contents.el | 151 ++++++++++++++++++++++++++++++++++++++--------
2 files changed, 132 insertions(+), 45 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile
index 7f2061d..3199fcc 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -9,34 +9,16 @@ SITE_DIR=site
all: all-in-place
-## Set up the source files for direct usage, by pointing
-## `package-directory-list' to the site/ directory.
-site: packages
- mkdir -p $(SITE_DIR)
- $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \
- --eval "(batch-make-site-dir \"packages\" \"$(SITE_DIR)\")"
-
-site/%: do-it
- $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \
- --eval "(progn (setq debug-on-error t) (batch-make-site-package
\"$@\"))"
-
## Deploy the package archive to archive/, with packages in
## archive/packages/:
archive: archive-tmp
$(MAKE) $(MFLAGS) process-archive
-archive-tmp: packages changelogs
+archive-tmp: packages
-rm -r $(ARCHIVE_TMP)
mkdir -p $(ARCHIVE_TMP)
cp -a packages/. $(ARCHIVE_TMP)/packages
-# Refresh the ChangeLog files. This needs to be done in
-# the source tree, because it needs the Bzr data!
-changelogs:
- cd packages; \
- $(EMACS) -batch -l $(CURDIR)/admin/archive-contents.el \
- -f batch-prepare-packages
-
process-archive:
# FIXME, we could probably speed this up significantly with
# rules like "%.tar: ../%/ChangeLog" so we only rebuild the packages
@@ -75,7 +57,7 @@ org-fetch: archive-tmp
clean:
rm -rf archive $(ARCHIVE_TMP) $(SITE_DIR)
-########## Rules for in-place installation ##########
+########## Rules for in-place installation ####################################
pkgs := $(foreach pkg, $(wildcard packages/*), \
$(if $(shell [ -d "$(pkg)" ] && echo true), $(pkg)))
@@ -152,3 +134,7 @@ $(extra_elcs):; rm $@
all-in-place: $(extra_elcs) $(autoloads) # $(single_pkgs)
# Do them in a sub-make, so that autoloads are done first.
$(MAKE) elcs
+
+
+############### Rules to prepare the externals ################################
+
diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index 56daa8e..5a5462a 100644
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -1,4 +1,4 @@
-;;; archive-contents.el --- Auto-generate an Emacs Lisp package archive.
+;;; archive-contents.el --- Auto-generate an Emacs Lisp package archive. -*-
lexical-binding:t -*-
;; Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc
@@ -24,6 +24,7 @@
(eval-when-compile (require 'cl))
(require 'lisp-mnt)
(require 'package)
+(require 'pcase)
(defconst archive-contents-subdirectory-regexp
"\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)")
@@ -86,7 +87,7 @@ Delete backup files also."
(write-region nil nil "archive-contents"))))
(defun batch-prepare-packages ()
- "Prepare the `packages' directory inside the Bzr checkout.
+ "Prepare the `packages' directory inside the Git checkout.
Expects to be called from within the `packages' directory.
\"Prepare\" here is for subsequent construction of the packages and archive,
so it is meant to refresh any generated files we may need.
@@ -218,6 +219,7 @@ package commentary to PKG-readme.txt. Return the
descriptor."
(if (file-readable-p "ChangeLog") (insert-file-contents "ChangeLog"))
(let ((old-md5 (md5 (current-buffer))))
(erase-buffer)
+ ;; git --no-pager log --date=short --format="%cd %aN
<%ae>%n%n%w(80,8,8)%B%n" | sed 's/^ /\t/'
(call-process "bzr" nil (current-buffer) nil
"log" "--gnu-changelog" ".")
(if (equal old-md5 (md5 (current-buffer)))
@@ -355,40 +357,95 @@ PKG-readme.txt. Return the descriptor."
((>= bytes 10) (format "%4.1f%s" bytes (car units)))
(t (format "%4.2f%s" bytes (car units))))))
+(defun archive--get-prop (prop name srcdir mainsrcfile)
+ (let ((kprop (intern (format ":%s" (downcase prop)))))
+ (or
+ (let ((pkgdescfile (expand-file-name (format "%s-pkg.el" name)
+ srcdir)))
+ (when (file-readable-p pkgdescfile)
+ (with-temp-buffer
+ (insert-file-contents pkgdescfile)
+ (let ((desc (read (current-buffer))))
+ (plist-get (cdr desc) kprop)))))
+ (when (file-readable-p mainsrcfile)
+ (with-temp-buffer
+ (insert-file-contents mainsrcfile)
+ (lm-header prop))))))
+
+(defun archive--get-section (hsection fsection srcdir mainsrcfile)
+ (cond
+ ((file-readable-p (expand-file-name fsection srcdir))
+ (with-temp-buffer
+ (insert-file-contents (expand-file-name fsection srcdir))
+ (buffer-string)))
+ ((file-readable-p mainsrcfile)
+ (with-temp-buffer
+ (insert-file-contents mainsrcfile)
+ (let ((start (lm-section-start hsection)))
+ (when start
+ (insert
+ (prog1
+ (buffer-substring start (lm-section-end hsection))
+ (erase-buffer)))
+ (emacs-lisp-mode)
+ (goto-char (point-min))
+ (delete-region (point) (line-beginning-position 2))
+ (uncomment-region (point-min) (point-max))
+ (when (looking-at "^\\([ \t]*\n\\)+")
+ (replace-match ""))
+ (goto-char (point-max))
+ (skip-chars-backward " \t\n")
+ (delete-region (point) (point-max))
+ (buffer-string)))))))
+
+(defun archive--quote (txt)
+ (replace-regexp-in-string "<" "<"
+ (replace-regexp-in-string "&" "&" txt)))
+
(defun archive--html-make-pkg (pkg files)
- (let ((name (symbol-name (car pkg)))
- (latest (package-version-join (aref (cdr pkg) 0)))
- (desc (aref (cdr pkg) 2)))
- ;; FIXME: Add maintainer info.
+ (let* ((name (symbol-name (car pkg)))
+ (latest (package-version-join (aref (cdr pkg) 0)))
+ (srcdir (expand-file-name name "../../build/packages"))
+ (mainsrcfile (expand-file-name (format "%s.el" name) srcdir))
+ (desc (aref (cdr pkg) 2)))
(with-temp-buffer
(insert (archive--html-header (format "GNU ELPA - %s" name)))
- (insert (format "<p>Description: %s</p>\n" desc))
+ (insert (format "<p>Description: %s</p>\n" (archive--quote desc)))
(let* ((file (cdr (assoc latest files)))
(attrs (file-attributes file)))
(insert (format "<p>Latest: <a href=%S>%s</a>, %s, %s</p>\n"
- file file
+ file (archive--quote file)
(format-time-string "%Y-%b-%d" (nth 5 attrs))
(archive--html-bytes-format (nth 7 attrs)))))
- ;; FIXME: This URL is wrong for Org.
- (let ((repurl (concat
"http://bzr.sv.gnu.org/lh/emacs/elpa/files/head:/packages/" name)))
- (insert (format "<p>Repository: <a href=%S>%s</a></p>" repurl repurl)))
- (let ((readme (concat name "-readme.txt"))
- (end (copy-marker (point) t)))
- (when (file-readable-p readme)
- (insert "<p>Full description:<pre>\n")
- (insert-file-contents readme)
- (goto-char end)
- (insert "\n</pre></p>")))
+ (let ((maint (archive--get-prop "Maintainer" name srcdir mainsrcfile)))
+ (when maint
+ (insert (format "<p>Maintainer: %s</p>\n" (archive--quote maint)))))
+ (let* ((urlkind "Origin")
+ (url
+ (or (archive--get-prop "URL" name srcdir mainsrcfile)
+ (progn
+ (setq urlkind "Repository")
+ (concat
"http://bzr.sv.gnu.org/lh/emacs/elpa/files/head:/packages/" name)))))
+ (insert (format "<p>%s: <a href=%S>%s</a></p>"
+ urlkind url (archive--quote url))))
+ (let ((readme (archive--get-section "Commentary" "README" srcdir
mainsrcfile)))
+ (when readme
+ (insert "<h2>Full description</h2><pre>\n" (archive--quote readme)
+ "\n</pre>\n")))
(unless (< (length files) 2)
- (insert (format "<p>Old versions:<table cellpadding=\"3\"
border=\"1\">\n"))
+ (insert (format "<h2>Old versions</h2><table cellpadding=\"3\"
border=\"1\">\n"))
(dolist (file files)
(unless (equal (pop file) latest)
(let ((attrs (file-attributes file)))
(insert (format "<tr><td><a
href=%S>%s</a></td><td>%s</td><td>%s</td>\n"
- file file
+ file (archive--quote file)
(format-time-string "%Y-%b-%d" (nth 5 attrs))
(archive--html-bytes-format (nth 7 attrs)))))))
- (insert "</table></body>\n"))
+ (insert "</table>\n"))
+ (let ((news (archive--get-section "News" "NEWS" srcdir mainsrcfile)))
+ (when news
+ (insert "<h2>News</h2><pre>\n" (archive--quote news) "\n</pre>\n")))
+ (insert "</body>\n")
(write-region (point-min) (point-max) (concat name ".html")))))
(defun archive--html-make-index (pkgs)
@@ -429,11 +486,55 @@ PKG-readme.txt. Return the descriptor."
;; FIXME: Add (old?) packages that are in `packages' but not in
;; archive-contents.
(archive--html-make-index archive-contents)))
-
-;; Local Variables:
-;; lexical-binding: t
-;; End:
+;;; Maintain external packages.
+
+(defun archive-add/remove-externals ()
+ (let ((exts (with-current-buffer (find-file-noselect "externals-list")
+ (goto-char (point-min))
+ (read (current-buffer)))))
+ (let ((default-directory (expand-file-name "packages/")))
+ ;; Remove "old/odd" externals.
+ (dolist (dir (directory-files "."))
+ (cond
+ ((member dir '("." "..")) nil)
+ ((assoc dir exts) nil)
+ ((file-directory-p (expand-file-name (format "%s/.git" dir)))
+ (let ((status
+ (with-temp-buffer
+ (let ((default-directory (file-name-as-directory
+ (expand-file-name dir))))
+ (call-process "git" nil t nil "status" "--porcelain")
+ (buffer-string)))))
+ (if (zerop (length status))
+ (progn (delete-directory dir 'recursive t)
+ (message "Deleted all of %s" dir))
+ (message "Keeping leftover unclean %s:\n%s" dir status))))))
+ (pcase-dolist (`(,dir ,kind ,url) exts)
+ (cond
+ ((not (file-exists-p dir))
+ (let* ((branch (concat "externals/" dir))
+ (output
+ (with-temp-buffer
+ ;; FIXME: Use git-new-workdir!
+ (call-process "git" nil t nil "branch" "--track"
+ branch (concat "origin/" branch))
+ (call-process "git" nil t nil "clone"
+ "--shared" "--branch" branch "../" dir)
+ ;; (let ((default-directory (file-name-as-directory
+ ;; (expand-file-name dir))))
+ ;; (call-process "git" nil t nil "branch"
+ ;; "-m" branch "master"))
+ (buffer-string))))
+ (message "Cloning branch %s:\n%s" dir output)))
+ ((not (file-directory-p (concat dir "/.git")))
+ (message "%s is in the way of an external, please remove!" dir))
+ (t
+ (let ((default-directory (expand-file-name dir)))
+ (with-temp-buffer
+ (call-process "git" nil t nil "pull")
+ (message "Updated %s:%s" dir (buffer-string))))
+ ))))))
(provide 'archive-contents)
;;; archive-contents.el ends here
- [elpa] elpa-admin 0c23652 046/357: Revert "Add an explicit OPERATION-MODE "nil" in README's examples", (continued)
- [elpa] elpa-admin 0c23652 046/357: Revert "Add an explicit OPERATION-MODE "nil" in README's examples", Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 7ce78d5 071/357: Note that 'autogen.sh' should be run to generate 'configure' and 'Makefile.in' (see #11), Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 5319f2f 062/357: * archive-contents.el: Make `site' more incrementally., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 988d3f5 059/357: Add a table of contents to README file, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 6011ab7 066/357: Initial import, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin aae2f27 064/357: imported README from googlecode's homepage, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin a745b29 076/357: * admin/archive-contents.el: Create web pages., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin b7f2140 081/357: Thanks go to Lars Andersen., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 5a664e2 091/357: Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 1daf0bb 085/357: Merge branch 'master' of github.com:rocky/emacs-loc-changes, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 90851ae 086/357: Get "make -k" to go through,
Stefan Monnier <=
- [elpa] elpa-admin e71d997 087/357: Merge remote-tracking branch 'repo.or.cz/elpa', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 87dd559 092/357: Update infrastructure for Git., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin efd0702 098/357: Fix generation of package autoloads, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin e55d6b1 102/357: Sync with yasnippet/master, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 170624f 106/357: Avoid lm-homepage which is not in Emacs-24.3, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 0306c73 111/357: update README, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 7db4e2d 112/357: small updates to README and NOTES, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 29880d4 115/357: Merge branch 'master' of git://bzr.sv.gnu.org/emacs/elpa, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin c398fd6 116/357: supports web sockets, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin c5f517e 130/357: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Stefan Monnier, 2020/12/10