[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] elpa-admin 2f122b0 251/357: Merge branch 'master' into new-websit
From: |
Stefan Monnier |
Subject: |
[elpa] elpa-admin 2f122b0 251/357: Merge branch 'master' into new-website |
Date: |
Thu, 10 Dec 2020 18:06:53 -0500 (EST) |
branch: elpa-admin
commit 2f122b050613520d0caedda2aba0ea633ddde830
Merge: a3dcbb3 858666e
Author: Nicolas Petton <nicolas@petton.fr>
Commit: Nicolas Petton <nicolas@petton.fr>
Merge branch 'master' into new-website
---
GNUmakefile | 6 ++++-
README | 2 +-
admin/archive-contents.el | 64 ++++++++++++++++++++++++++++++++++-------------
3 files changed, 53 insertions(+), 19 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile
index d23d523..7d6d100 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -8,7 +8,7 @@ SITE_DIR=site
.PHONY: archive-tmp changelogs process-archive archive-full org-fetch clean
all do-it
-all: all-in-place
+all: all-in-place .gitignore
CR_EXCEPTIONS=copyright_exceptions
.PHONY: check_copyrights
@@ -81,6 +81,10 @@ archive-full: archive-tmp org-fetch
#mkdir -p archive/admin
#cp admin/* archive/admin/
+.gitignore: externals-list
+ $(EMACS) -l $(CURDIR)/admin/archive-contents.el \
+ --eval '(archive-gitignore-externals "$<" "$@")'
+
# FIXME: Turn it into an `external', which will require adding the notion of
# "snapshot" packages.
org-fetch: archive-tmp
diff --git a/README b/README
index 7c5cd36..57d9ca9 100644
--- a/README
+++ b/README
@@ -37,7 +37,7 @@ release the new code.
** To add a package: (submission, submit)
Adding a basic package is very simple. There are thorough
-instructional, but the gist is that you:
+instructions below, but the gist of it is that you:
1. Notify emacs-devel@gnu.org.
2. Place all files inside `packages/<pkg-name>/'.
diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index f3b4db8..7af9b3c 100755
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -1,6 +1,6 @@
;;; archive-contents.el --- Auto-generate an Emacs Lisp package archive. -*-
lexical-binding:t -*-
-;; Copyright (C) 2011-2015 Free Software Foundation, Inc
+;; Copyright (C) 2011-2016 Free Software Foundation, Inc
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
@@ -21,7 +21,7 @@
;;; Code:
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
(require 'lisp-mnt)
(require 'package)
(require 'pcase)
@@ -36,8 +36,8 @@
(when vers
(let ((l (version-to-list vers)))
;; Signal an error for things like "1.02" which is parsed as "1.2".
- (assert (equal vers (package-version-join l)) nil
- "Unsupported version syntax %S" vers)
+ (cl-assert (equal vers (package-version-join l)) nil
+ "Unsupported version syntax %S" vers)
l)))
(defun archive--convert-require (elt)
@@ -585,6 +585,14 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
packages)
(archive--html-make-index archive-contents)))
+(defun archive--pull (dirname)
+ (let ((default-directory (file-name-as-directory
+ (expand-file-name dirname))))
+ (with-temp-buffer
+ (message "Running git pull in %S" default-directory)
+ (call-process "git" nil t nil "pull")
+ (message "Updated %s:\n%s" dirname (buffer-string)))))
+
;;; Maintain external packages.
(defconst archive--elpa-git-url "git://git.sv.gnu.org/emacs/elpa")
@@ -603,10 +611,8 @@ Return non-nil if there's an \"emacs\" repository present."
(if (not (file-directory-p emacs-repo-root))
(progn (message "No \"emacs\" subdir: will skip :core packages")
nil)
- (let ((default-directory emacs-repo-root))
- (message "Running git pull in %S" default-directory)
- (call-process "git" nil t nil "pull")
- t))))
+ (archive--pull emacs-repo-root)
+ t)))
(defun archive--find-non-trivial-file (dir)
(catch 'found-important-file
@@ -627,7 +633,13 @@ If WITH-CORE is non-nil, it means we manage :core packages
as well."
(let ((default-directory (expand-file-name "packages/")))
(dolist (dir (directory-files "."))
(cond
- ((or (not (file-directory-p dir)) (file-symlink-p dir))
+ ((file-symlink-p dir)
+ ;; There are normally no such thing, but the user may elect to
+ ;; add symlinks to other projects. If so, update them, as if they
+ ;; were "externals".
+ (when (file-directory-p (expand-file-name ".git" dir))
+ (archive--pull dir)))
+ ((or (not (file-directory-p dir)) )
;; We only add/remove plain directories in elpa/packages (not
;; symlinks).
nil)
@@ -666,7 +678,7 @@ If WITH-CORE is non-nil, it means we manage :core packages
as well."
(let* ((branch (concat "externals/" name))
(output
(with-temp-buffer
- ;; FIXME: Use git-new-workdir!
+ ;; FIXME: Use `git worktree'!
(call-process "git" nil t nil "clone"
"--reference" ".." "--single-branch"
"--branch" branch
@@ -675,13 +687,7 @@ If WITH-CORE is non-nil, it means we manage :core packages
as well."
(message "Cloning branch %s:\n%s" name output)))
((not (file-directory-p (concat name "/.git")))
(message "%s is in the way of an external, please remove!" name))
- (t
- (let ((default-directory (file-name-as-directory
- (expand-file-name name))))
- (with-temp-buffer
- (message "Running git pull in %S" default-directory)
- (call-process "git" nil t nil "pull")
- (message "Updated %s:%s" name (buffer-string))))))))
+ (t (archive--pull name)))))
(defun archive--core-package-empty-dest-p (dest)
"Return non-nil if DEST is an empty variant."
@@ -784,5 +790,29 @@ If WITH-CORE is non-nil, it means we manage :core packages
as well."
(_ (message "Unknown external package kind `%S' for %s"
kind name)))))))
+;;; Manage .gitignore
+
+(defun archive-gitignore-externals (elf gf)
+ (let* ((el (read (find-file-noselect elf)))
+ (exts (delq nil
+ (mapcar (lambda (x)
+ (if (eq :external (nth 1 x)) (car x)))
+ el)))
+ (core (delq nil
+ (mapcar (lambda (x)
+ (if (eq :core (nth 1 x)) (car x)))
+ el))))
+ (with-current-buffer (find-file-noselect gf)
+ (goto-char (point-min))
+ (when (re-search-forward
+ "#.*External.*git.*\n\\(packages/[^*/\n]+/?\n\\)+"
+ nil 'move)
+ (replace-match ""))
+ (insert "# External packages with their own .git tree [autogenerated].\n"
+ (mapconcat (lambda (p) (format "packages/%s/\n" p))
+ (sort (append exts core) #'string<)
+ ""))
+ (save-buffer))))
+
(provide 'archive-contents)
;;; archive-contents.el ends here
- [elpa] elpa-admin 3a394c3 188/357: Merge commit 'd76bcd7c0dcecb33e6955e25963028600c371588', (continued)
- [elpa] elpa-admin 3a394c3 188/357: Merge commit 'd76bcd7c0dcecb33e6955e25963028600c371588', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 7558d12 206/357: Make externals directory removal safer, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin a8b876c 207/357: * admin/archive-contents.el: Make :core handling optional, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 3a129d5 190/357: Add support to build packages from Emacs repo, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 581dd5b 231/357: Fix a typo in the readme, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin f79a619 218/357: * packages/gnome-c-style/gnome-c-tests.el: Add copyright blurb, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 28819e8 192/357: Skip uninteresting elements, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 345dc39 189/357: * GNUmakefile: Use LC_ALL rather than LANG, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 368a212 219/357: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 7edd6ff 205/357: Dereference symlinks when creating tarballs, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 2f122b0 251/357: Merge branch 'master' into new-website,
Stefan Monnier <=
- [elpa] elpa-admin da3bd64 263/357: [admin int] Use ‘archive--read-externals-list’ more., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 34ecb5f 257/357: Respect .elpaignore when compiling and optimize compilation., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 186d10f 269/357: Clear executable bit for Emacs Lisp files., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin ac713ed 242/357: Merge commit 'bdbbc65028af8deb55a4e474be43b5b99e6cc539', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 5660f25 261/357: [admin] Add abstraction: archive--read-externals-list, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin a23a8b8 271/357: Merge branch 'scratch/hook-helpers', Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 1325337 262/357: [admin int] Simplify ‘archive-gitignore-externals’., Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 84f67ae 294/357: * admin/archive-contents.el (archive--insert-repolinks): Fix last change, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin 655d2e7 305/357: Update packages/ack from upstream, Stefan Monnier, 2020/12/10
- [elpa] elpa-admin c943660 310/357: Merge commit '98405112baa5ce2a118d1c65184c005d8ddaa1a9', Stefan Monnier, 2020/12/10