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

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

[debbugs-tracker] bug#21319: closed (`package-install-file' fails with C


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#21319: closed (`package-install-file' fails with CRLF (Windows) line endings)
Date: Tue, 22 Oct 2019 13:04:05 +0000

Your message dated Tue, 22 Oct 2019 16:03:12 +0300
with message-id <address@hidden>
and subject line Re: bug#20309: 25.0.50; Coding conversion error during 
clojure-mode package upgrade
has caused the debbugs.gnu.org bug report #20309,
regarding `package-install-file' fails with CRLF (Windows) line endings
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
20309: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20309
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: `package-install-file' fails with CRLF (Windows) line endings Date: Sat, 22 Aug 2015 06:30:30 +0200
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).

What we did now is to replace `insert-file-contents-literally' with
`insert-file-contents' dynamically for non-tar files and that seems to
work, although I'm not sure if that's a good solution since I don't
know if there might be side-effects somewhere that can cause other
problems.

The other solution I can think of might be to adapt the regexp in
`package-buffer-info` so that in can deal with CRLF.

cheers,
steckerhalter



--- End Message ---
--- Begin Message --- Subject: Re: bug#20309: 25.0.50; Coding conversion error during clojure-mode package upgrade Date: Tue, 22 Oct 2019 16:03:12 +0300 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0
On 22.10.2019 3:57, Stefan Kangas wrote:
I can't reproduce this on current master.  I believe that it has been
fixed by the following commit (if not before)

Thank you for the reminder.

I haven't seen this lately, so: closing.


--- End Message ---

reply via email to

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