GNU bug report logs - #21319
`package-install-file' fails with CRLF (Windows) line endings

Previous Next

Package: emacs;

Reported by: steckerhalter <emacs <at> postmomentum.ch>

Date: Sat, 22 Aug 2015 05:39:02 UTC

Severity: minor

Tags: moreinfo

Found in version 25.0.50

Fixed in version 29.1

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

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Kangas <stefan <at> marxist.se>
To: steckerhalter <emacs <at> postmomentum.ch>
Cc: 21319 <at> debbugs.gnu.org
Subject: Re: bug#21319: `package-install-file' fails with CRLF (Windows) line
 endings
Date: Tue, 22 Oct 2019 16:50:44 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> steckerhalter <emacs <at> postmomentum.ch> writes:
>
> > package.el contains this code:
> >
> > (defun package-install-file (file)
> >   "Install a package from a file.
> > The file can either be a tar file or an Emacs Lisp file."
> >   (interactive "fPackage file name: ")
> >   (with-temp-buffer
> >     (insert-file-contents-literally file)
> >     (when (string-match "\\.tar\\'" file) (tar-mode))
> >     (package-install-from-buffer)))
> >
> > Since `insert-file-contents-literally' does not do any conversion
> > `package-buffer-info' fails to parse the info if the file is .el and
> > contains CRLF line endings. It then errors out with:
> >
> > Debugger entered--Lisp error: (error "Package lacks a \"Version\" or
> > \"Package-Version\" header")
> >   signal(error ("Package lacks a \"Version\" or \"Package-Version\" header"))
> >   error("Package lacks a \"Version\" or \"Package-Version\" header")
> >   package-buffer-info()
> >
> > This affects all recent Emacs versions (including trunk).
>
> This was reported 4 years ago, but unfortunately never got a reply at
> the time.
>
> Are you still seeing this on a recent version of Emacs?  If yes, could
> you please provide a minimal example file which fails to install?
>
> Also, why does your file have these line endings in the first place?
> Was this file written in Emacs?  I'm trying to understand if this is
> an important use case or the common scenario for users of MS-Windows,
> since I don't use it myself.

This was merged with Bug#20309, which was closed.  I suspect that the
bugs are most probably different, so I've unmerged this bug and
reopened it.  Please disregard any message saying that this bug is
closed for now.

Best regards,
Stefan Kangas




This bug report was last modified 3 years and 115 days ago.

Previous Next


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