all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Xingyu Pu <pu.stshine@gmail.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 53805@debbugs.gnu.org
Subject: bug#53805: 27.2; NonGNU ELPA: helm does not install dependencies
Date: Sat, 05 Feb 2022 19:08:50 +0000	[thread overview]
Message-ID: <8735kx3zct.fsf@posteo.net> (raw)
In-Reply-To: <CAGmbx=jekqdav8A53PCwNHSVEC0ozEjqiuGr-1PAG=R6XAvoZg@mail.gmail.com> (Xingyu Pu's message of "Sat, 5 Feb 2022 22:52:49 +0800")

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

Xingyu Pu <pu.stshine@gmail.com> writes:

> When installing helm from the NonGNU ELPA, packages that helm requires
> is not installed.
>
> Step to reproduce:
>
> Add nongnu repository to package-archives.
> List packages by M-x list-packages.
> Select helm from nongnu and install.
> Package helm-core, async, popup that helm requires is not installed.

It seems to me that the core of the issue is that the ELPA build system
overrides the existing -pkg.el files, by trying to infer all the package
metadata from the main files (helm.el, helm-core.el).  If as in the case
of helm and helm-core these are empty, this leads to unexpected results.

This patch seems to fix the issue on my end:


[-- Attachment #2: Type: text/plain, Size: 1356 bytes --]

diff --git a/elpa-admin.el b/elpa-admin.el
index d570c3c6aa..6714cd07a4 100644
--- a/elpa-admin.el
+++ b/elpa-admin.el
@@ -1015,14 +1015,25 @@ EXTRAS is an alist with additional metadata.
 PKG is the name of the package and DIR is the directory where it is."
   (let* ((pkg (car pkg-spec))
          (mainfile (expand-file-name (elpaa--main-file pkg-spec) dir))
+         (desc-file (expand-file-name (concat pkg "-pkg.el") dir))
          (files (directory-files dir nil "\\`dir\\'\\|\\.el\\'")))
     (setq files (delete (concat pkg "-pkg.el") files))
     (setq files (delete (concat pkg "-autoloads.el") files))
     (cond
+     ((file-exists-p desc-file)
+      (with-temp-buffer
+        (insert-file-contents desc-file)
+        (let* ((form (read (current-buffer)))
+               (pkg-desc (apply #'package-desc-from-define (cdr form))))
+          (list (= (length files) 1)
+                (package-version-join (package-desc-version pkg-desc))
+                (package-desc-summary pkg-desc)
+                (package-desc-reqs pkg-desc)
+                nil))))
      ((file-exists-p mainfile)
       (with-temp-buffer
-	(insert-file-contents mainfile)
-	(goto-char (point-min))
+        (insert-file-contents mainfile)
+        (goto-char (point-min))
         (let* ((pkg-desc
                 (unwind-protect
                     (progn

[-- Attachment #3: Type: text/plain, Size: 195 bytes --]


But it hasn't been thoroughly tested.

Another possibility I don't want to exclude is that I messed up the
package specification when adding the packages to the archive.

-- 
	Philip Kaludercic

  reply	other threads:[~2022-02-05 19:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-05 14:52 bug#53805: 27.2; NonGNU ELPA: helm does not install dependencies Xingyu Pu
2022-02-05 19:08 ` Philip Kaludercic [this message]
2022-02-05 22:16   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-05 22:29     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-06  8:22     ` Thierry Volpiatto
2022-02-06 10:12       ` Philip Kaludercic
2022-02-06 14:57       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-06 16:07         ` Thierry Volpiatto
2022-02-06 16:26           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-06 17:57             ` Thierry Volpiatto
2022-02-06 19:19               ` Xingyu Pu
2022-02-06 20:40               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-10 14:16               ` Pu Xingyu
2022-02-10 16:35                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-11 17:49                   ` Pu Xingyu
2022-02-11 18:46                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-06 15:52       ` Thierry Volpiatto
2022-02-06 16:21         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735kx3zct.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=53805@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=pu.stshine@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.