From: Ioannis Kappas <ioannis.kappas@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 48137@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings
Date: Thu, 6 May 2021 07:55:52 +0100 [thread overview]
Message-ID: <CAMRHuGDp0-3XHpqZ1+tyH8pMhFBuhqnx0n1WVhK8Z71nUbvisQ@mail.gmail.com> (raw)
In-Reply-To: <CAMRHuGAi9+q-MKRGPxLqxdP_7SSF4Nqj+JuSsZigviAQs_d7Rw@mail.gmail.com>
On Wed, May 5, 2021 at 1:01 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Ioannis Kappas <ioannis.kappas@gmail.com>
> > Date: Wed, 5 May 2021 08:03:17 +0100
> > Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 48137@debbugs.gnu.org
> >
> > Currently, `package-install-file' reads the package contents into a
> > buffer and calls `package-install-from-buffer' to parse the headers,
> > download & install its dependencies, and finally install the package
> > itself from the buffer.
> >
> > Just to confirm, what we are discussing as a solution (at a high
> > level) is to parse the package headers from a decoded buffer, download
> > & install its dependencies, and copy/extract the package file to the
> > elpa user dir?
>
> My idea was to read the file literally, without decoding, then parse
> the package headers from that.
I suppose you mean something along the other option below?
>
> > Another solution could be to upgrade the 'lisp-mnt package to ignore
> > ?\r characters. Looking at the `lm-header' fn invoked by
> > `package-buffer-info', it does have a list of characters to stop at
> > when looking for a header, we can thus add the carriage return to the
> > list:
> >
> > diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
> > index 9cba232e16..3eb493d286 100644
> > --- a/lisp/emacs-lisp/lisp-mnt.el
> > +++ b/lisp/emacs-lisp/lisp-mnt.el
> > @@ -267,7 +267,7 @@ lm-header
> > (if (save-excursion
> > (skip-chars-backward "^$" (match-beginning 0))
> > (= (point) (match-beginning 0)))
> > - "[^\n]+" "[^$\n]+")))
> > + "[^\n\r]+" "[^$\n\r]+")))
>
> This is better, but IMO the code should be rewritten not to allow a
> lone CR character, only either a lone LF or the CRLF pair.
Thanks
next prev parent reply other threads:[~2021-05-06 6:55 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-01 11:38 bug#48137: 27.2; `package-install-file' fails when loading a package file with DOS line endings Ioannis Kappas
2021-05-01 11:48 ` Ioannis Kappas
2021-05-01 12:15 ` Eli Zaretskii
2021-05-01 13:51 ` Stefan Monnier
2021-05-03 17:47 ` Ioannis Kappas
2021-05-03 18:23 ` Stefan Monnier
2021-05-03 18:33 ` Eli Zaretskii
2021-05-03 18:49 ` Ioannis Kappas
2021-05-03 18:52 ` Eli Zaretskii
2021-05-03 20:12 ` Stefan Monnier
2021-05-04 11:39 ` Eli Zaretskii
2021-05-03 19:41 ` Stefan Monnier
2021-05-04 11:34 ` Eli Zaretskii
2021-05-04 15:57 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-04 16:14 ` Eli Zaretskii
2021-05-04 16:27 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-04 16:51 ` Eli Zaretskii
2021-05-05 7:03 ` Ioannis Kappas
2021-05-05 12:01 ` Eli Zaretskii
[not found] ` <CAMRHuGAi9+q-MKRGPxLqxdP_7SSF4Nqj+JuSsZigviAQs_d7Rw@mail.gmail.com>
2021-05-06 6:55 ` Ioannis Kappas [this message]
2021-05-06 8:12 ` Eli Zaretskii
2021-05-06 13:27 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-06 15:26 ` Eli Zaretskii
2021-05-11 6:52 ` Ioannis Kappas
2021-05-11 12:55 ` Eli Zaretskii
2021-05-15 13:52 ` Ioannis Kappas
2021-05-16 9:09 ` Ioannis Kappas
2021-05-29 8:20 ` Eli Zaretskii
2021-05-29 13:59 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-29 14:09 ` Eli Zaretskii
2021-06-06 9:11 ` Ioannis Kappas
2021-07-20 13:54 ` Lars Ingebrigtsen
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=CAMRHuGDp0-3XHpqZ1+tyH8pMhFBuhqnx0n1WVhK8Z71nUbvisQ@mail.gmail.com \
--to=ioannis.kappas@gmail.com \
--cc=48137@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.