bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48137: 27.2; `package-install-file' fails when loading a package fil


From: Ioannis Kappas
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

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]