GNU bug report logs - #48137
27.2; `package-install-file' fails when loading a package file with DOS line endings

Previous Next

Package: emacs;

Reported by: Ioannis Kappas <ioannis.kappas <at> gmail.com>

Date: Sat, 1 May 2021 11:40:02 UTC

Severity: normal

Tags: patch

Found in version 27.2

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 48137 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Ioannis Kappas <ioannis.kappas <at> gmail.com>, 48137 <at> debbugs.gnu.org
Subject: Re: bug#48137: 27.2; `package-install-file' fails when loading a
 package file with DOS line endings
Date: Mon, 03 May 2021 16:12:17 -0400
>> If not, I would like to suggest a slightly
>> updated patch that is targeting .el files directly as an exemption:
>> 
>> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
>> index ecb2573cab..19ab0445b9 100644
>> --- a/lisp/emacs-lisp/package.el
>> +++ b/lisp/emacs-lisp/package.el
>> @@ -2147,7 +2147,9 @@ package-install-file
>>          (progn
>>            (setq default-directory file)
>>            (dired-mode))
>> -      (insert-file-contents-literally file)
>> +      (if (string-match "\\.el\\'" file)
>> +          (insert-file-contents file)
>> +        (insert-file-contents-literally file))
>>        (when (string-match "\\.tar\\'" file) (tar-mode)))
>>      (package-install-from-buffer)))
>
> is not something I can endorse, especially as it decodes much more
> than just the EOL format.

package.el should do *some* decoding because it needs to look at
the pseudo-headers in the file to generate the `<pkg>-pkg.el` which
contains among other things the package's short description.
Admittedly, these will usually work OK in undecoded buffers as well,
but not in all cases.


        Stefan





This bug report was last modified 4 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.