unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* add elpaa-batch-make-one-devel to elpa/admin/elpa-admin.el
@ 2021-07-29 16:23 Stephen Leake
  2021-08-03 20:14 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Leake @ 2021-07-29 16:23 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

The attached patch adds elpaa-batch-make-one-devel to elpa-admin.el, and
adds a work-around for no symlink on Windows.

elpaa-batch-make-one-devel builds the tarball for one package; this
allows testing the package via list-packages by setting:

(add-to-list 'package-archives (cons "test" "/Projects/elpa/archive-devel"))

Ok to commit?

-- 
-- Stephe

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: make-one-devel.patch --]
[-- Type: text/x-patch, Size: 3561 bytes --]

diff --git a/elpa-admin.el b/elpa-admin.el
index bd2e7fed4d..98137808e9 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -319,7 +319,7 @@ Do it without leaving the current branch."
              (elpaa--message "%s" (buffer-string)))))))))
 
 (defun elpaa--make-one-tarball ( tarball dir pkg-spec metadata
-                                 &optional revision-function one-tarball)
+                                 &optional revision-function one-tarball no-symlink)
   "Create file TARBALL for PKGNAME if not done yet.
 Return non-nil if a new tarball was created."
   (elpaa--message "Building tarball %s..." tarball)
@@ -397,9 +397,11 @@ Return non-nil if a new tarball was created."
                 (elpaa--call nil "git" "tag" "-f"
                              (format "%s-release/%s-%s"
                                      elpaa--name pkgname vers))))
-            (let ((link (expand-file-name (format "%s.tar" pkgname) destdir)))
-              (when (file-symlink-p link) (delete-file link))
-              (make-symbolic-link (file-name-nondirectory tarball) link))
+	    (unless no-symlink
+              (let ((link (expand-file-name (format "%s.tar" pkgname) destdir)))
+		(when (file-symlink-p link) (delete-file link))
+		;; FIXME: make-symbolic-link not supported on Windows
+		(make-symbolic-link (file-name-nondirectory tarball) link)))
             (dolist (oldtarball oldtarballs)
               ;; Compress oldtarballs.
               (let ((file (cdr oldtarball)))
@@ -472,6 +474,13 @@ Return non-nil if a new tarball was created."
     (elpaa--make-one-package (elpaa--get-package-spec
                                 (pop command-line-args-left)))))
 
+(defun elpaa-batch-make-one-devel (&rest _)
+  "Build the new devel tarball (if needed) for packages listed on command line."
+  (while command-line-args-left
+    (let* ((pkgname (pop command-line-args-left))
+	   (pkg-spec (elpaa--get-package-spec pkgname)))
+      (elpaa--make-one-package pkg-spec nil t))))
+
 (defun elpaa-batch-make-one-tarball (&rest _)
   "Build a tarball for a particular package."
   (while command-line-args-left
@@ -481,10 +490,11 @@ Return non-nil if a new tarball was created."
       (delete-file tarball)
       (elpaa--make-one-package pkg-spec tarball))))
 
-(defun elpaa--make-one-package (pkg-spec &optional one-tarball)
+(defun elpaa--make-one-package (pkg-spec &optional one-tarball devel-only)
   "Build the new tarballs (if needed) for PKG-SPEC.
 If ONE-TARBALL is non-nil, don't try and select some other revision and
-place the resulting tarball into the file named ONE-TARBALL."
+place the resulting tarball into the file named ONE-TARBALL.
+If DEVEL-ONLY is non-nil, only build the devel tarball."
   (elpaa--message "Checking package %s for updates..." (car pkg-spec))
   (let* ((pkgname (car pkg-spec))
          (dir (expand-file-name pkgname "packages"))
@@ -523,11 +533,12 @@ place the resulting tarball into the file named ONE-TARBALL."
                                          dir pkg-spec
                                          `(nil ,devel-vers
                                                . ,(nthcdr 2 metadata))
-                                         nil one-tarball))))
+                                         nil one-tarball devel-only))))
 
         ;; Try and build the latest release tarball.
         (cond
          (one-tarball nil)
+	 (devel-only nil)
          ((or (equal vers "0")
               ;; -4 is used for "NN.MMsnapshot" and "NN.MM-git"
               (member '-4 (version-to-list vers)))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: add elpaa-batch-make-one-devel to elpa/admin/elpa-admin.el
  2021-07-29 16:23 add elpaa-batch-make-one-devel to elpa/admin/elpa-admin.el Stephen Leake
@ 2021-08-03 20:14 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2021-08-03 20:14 UTC (permalink / raw)
  To: Stephen Leake; +Cc: emacs-devel

Stephen Leake [2021-07-29 09:23:57] wrote:
> The attached patch adds elpaa-batch-make-one-devel to elpa-admin.el, and
> adds a work-around for no symlink on Windows.
> elpaa-batch-make-one-devel builds the tarball for one package; this
> allows testing the package via list-packages by setting:
>
> (add-to-list 'package-archives (cons "test" "/Projects/elpa/archive-devel"))
>
> Ok to commit?

I'm not opposed to it, tho I wonder why you need
`elpaa-batch-make-one-devel` since the use cases I can imagine shouldn't
be bothered by the fact that `elpaa-batch-make-one-package` also (tries
to) builds the non-devel version.


        Stefan




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-03 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 16:23 add elpaa-batch-make-one-devel to elpa/admin/elpa-admin.el Stephen Leake
2021-08-03 20:14 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).