[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa-admin 73304d8 097/439: Fix up deployment script
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa-admin 73304d8 097/439: Fix up deployment script |
Date: |
Sun, 17 Oct 2021 15:47:40 -0400 (EDT) |
branch: elpa-admin
commit 73304d81d140c4b14b00271251954f1bf41ed47e
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Fix up deployment script
---
admin/archive-contents.el | 56 +++++++++++++++++++++++++++++++----------------
1 file changed, 37 insertions(+), 19 deletions(-)
diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index e2154df..2d588e9 100644
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -32,9 +32,16 @@
(defconst archive-re-no-dot "\\`\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"
"Regular expression matching all files except \".\" and \"..\".")
+(defun archive--version-to-list (vers)
+ (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)))
+ l)))
+
(defun archive--convert-require (elt)
(list (car elt)
- (version-to-list (car (cdr elt)))))
+ (archive--version-to-list (car (cdr elt)))))
(defun archive--strip-rcs-id (str)
"Strip RCS version ID from the version string STR.
@@ -44,7 +51,7 @@ Otherwise return nil."
(when (string-match "\\`[ \t]*[$]Revision:[ \t]+" str)
(setq str (substring str (match-end 0))))
(condition-case nil
- (if (version-to-list str)
+ (if (archive--version-to-list str)
str)
(error nil))))
@@ -79,10 +86,12 @@ Delete backup files also."
(push (if (car simple-p)
(apply #'archive--process-simple-package
dir pkg (cdr simple-p))
- (apply 'archive--write-pkg-file dir pkg (cdr simple-p))
+ (if simple-p
+ (apply #'archive--write-pkg-file
+ dir pkg (cdr simple-p)))
(archive--process-multi-file-package dir pkg))
packages)))
- (error (error "Error in %s: %S" dir v))))
+ ((debug error) (error "Error in %s: %S" dir v))))
(with-temp-buffer
(pp (nreverse packages) (current-buffer))
(write-region nil nil "archive-contents"))))
@@ -156,8 +165,7 @@ REQ is a list of requirements.
Otherwise, return nil."
(let* ((pkg-file (expand-file-name (concat pkg "-pkg.el") dir))
(mainfile (expand-file-name (concat pkg ".el") dir))
- (files (directory-files dir nil "\\.el\\'"))
- version description req)
+ (files (directory-files dir nil "\\.el\\'")))
(setq files (delete (concat pkg "-pkg.el") files))
(setq files (delete (concat pkg "-autoloads.el") files))
(cond
@@ -168,17 +176,20 @@ Otherwise, return nil."
(goto-char (point-min))
(if (not (looking-at ";;;.*---[ \t]*\\(.*?\\)[ \t]*\\(-\\*-.*-\\*-[
\t]*\\)?$"))
(error "Can't parse first line of %s" mainfile)
- (setq description (match-string 1))
- (setq version
- (or (archive--strip-rcs-id (lm-header "package-version"))
- (archive--strip-rcs-id (lm-header "version"))
- (error "Missing `version' header")))
;; Grab the other fields, which are not mandatory.
- (let ((requires-str (lm-header "package-requires")))
- (if requires-str
- (setq req (mapcar 'archive--convert-require
- (car (read-from-string requires-str))))))
- (list (= (length files) 1) version description req))))
+ (let* ((description (match-string 1))
+ (version
+ (or (archive--strip-rcs-id (lm-header "package-version"))
+ (archive--strip-rcs-id (lm-header "version"))
+ (error "Missing `version' header")))
+ (requires-str (lm-header "package-requires"))
+ (pt (lm-header "package-type"))
+ (simple (if pt (equal pt "simple") (= (length files) 1)))
+ (req
+ (if requires-str
+ (mapcar 'archive--convert-require
+ (car (read-from-string requires-str))))))
+ (list simple version description req)))))
((not (file-exists-p pkg-file))
(error "Can find single file nor package desc file in %s" dir)))))
@@ -207,7 +218,8 @@ Rename DIR/PKG.el to PKG-VERS.el, delete DIR, and return
the descriptor."
(basic-save-buffer) ;Less chatty than save-buffer.
(kill-buffer)))
(delete-directory dir t)
- (cons (intern pkg) (vector (version-to-list vers) req desc 'single)))
+ (cons (intern pkg) (vector (archive--version-to-list vers)
+ req desc 'single)))
(defun archive--make-changelog (dir srcdir)
"Export Git log info of DIR into a ChangeLog file."
@@ -239,12 +251,18 @@ Rename DIR/PKG.el to PKG-VERS.el, delete DIR, and return
the descriptor."
Rename DIR/ to PKG-VERS/, and return the descriptor."
(let* ((exp (archive--multi-file-package-def dir pkg))
(vers (nth 2 exp))
- (req (mapcar 'archive--convert-require (nth 4 exp))))
+ (req-exp (nth 4 exp))
+ (req (mapcar 'archive--convert-require
+ (if (eq 'quote (car-safe req-exp)) (nth 1 req-exp)
+ (when req-exp
+ (error "REQ should be a quoted constant: %S"
+ req-exp))))))
(unless (equal (nth 1 exp) pkg)
(error (format "Package name %s doesn't match file name %s"
(nth 1 exp) pkg)))
(rename-file dir (concat pkg "-" vers))
- (cons (intern pkg) (vector (version-to-list vers) req (nth 3 exp) 'tar))))
+ (cons (intern pkg) (vector (archive--version-to-list vers)
+ req (nth 3 exp) 'tar))))
(defun archive--multi-file-package-def (dir pkg)
"Return the `define-package' form in the file DIR/PKG-pkg.el."
- [nongnu] elpa-admin becd7be 063/439: * archive-contents.el (archive--make-changelog): New fun., (continued)
- [nongnu] elpa-admin becd7be 063/439: * archive-contents.el (archive--make-changelog): New fun., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 6c94727 068/439: archive-contents.el (archive--simple-package-p): Fix prop-line matching., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin dc8ca2b 072/439: Note availability of Melpa packages, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 518362a 073/439: Merge pull request #13 from dgutov/master, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 50b05c8 074/439: Add SML-mode., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 4eaf276 078/439: * admin/archive-contents.el (batch-make-archive): Don't demote errors., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b7f2140 081/439: Thanks go to Lars Andersen., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 87dd559 092/439: Update infrastructure for Git., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 2ebff0e 093/439: Use README.{rst,md,org}; Auto-generate foo-pkg.el., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 55c3f5d 100/439: Add YAsnippet metadata., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 73304d8 097/439: Fix up deployment script,
Philip Kaludercic <=
- [nongnu] elpa-admin c8efad2 096/439: Fix up copyrights and the checking code, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 4f4a301 104/439: * GNUmakefile: Obey a .elpaignore file in a package's root directory., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin e38e391 108/439: Use lm-keywords-list instead of split-string for archive contents., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 7db4e2d 112/439: small updates to README and NOTES, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin b84cae0 119/439: * archive-contents.el (archive--simple-package-p): Quote the, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 876bb45 128/439: Merge git+ssh://git.sv.gnu.org/srv/git/emacs/elpa, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin e52215f 124/439: first commit, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin a0b6599 127/439: Subject: Fix up quoting of keywords. Remove leftover support for *-pkg.el., Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin f5586f2 135/439: bump version to 0.1.1, Philip Kaludercic, 2021/10/17
- [nongnu] elpa-admin 27c180f 145/439: * README: Update for new "Version: 0" convention., Philip Kaludercic, 2021/10/17