unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20309: 25.0.50; Coding conversion error during clojure-mode package upgrade
@ 2015-04-12 13:46 Dmitry Gutov
  2019-10-22  0:57 ` Stefan Kangas
  2019-10-22  1:04 ` bug#20309: bug#21319: `package-install-file' fails with CRLF (Windows) line endings Stefan Kangas
  0 siblings, 2 replies; 11+ messages in thread
From: Dmitry Gutov @ 2015-04-12 13:46 UTC (permalink / raw)
  To: 20309

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

The package is being installed from MELPA, the file can be viewed at
http://melpa.org/packages/clojure-mode-20150410.2319.el.

Viewing it in the browser (or downloading and opening in `less')
displays those copyright characters just fine.

Not so here, see the attached screenshot.


[-- Attachment #2: Select coding system... --]
[-- Type: image/png, Size: 136453 bytes --]

[-- Attachment #3: Type: text/plain, Size: 265 bytes --]


In GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)
 of 2015-04-12 on axl
Repository revision: d0fcb21254394e22542dbc350220db3bafe0cc13
Windowing system distributor `The X.Org Foundation', version 11.0.11601901
System Description:	Ubuntu 14.10


^ permalink raw reply	[flat|nested] 11+ messages in thread
* bug#21319: `package-install-file' fails with CRLF (Windows) line endings
@ 2015-08-22  4:30 steckerhalter
  0 siblings, 0 replies; 11+ messages in thread
From: steckerhalter @ 2015-08-22  4:30 UTC (permalink / raw)
  To: 21319

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-01-29 17:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-12 13:46 bug#20309: 25.0.50; Coding conversion error during clojure-mode package upgrade Dmitry Gutov
2019-10-22  0:57 ` Stefan Kangas
2019-10-22 13:03   ` Dmitry Gutov
2019-10-22  1:04 ` bug#20309: bug#21319: `package-install-file' fails with CRLF (Windows) line endings Stefan Kangas
2019-10-22 14:50   ` Stefan Kangas
2019-11-29 12:58   ` Stefan Kangas
2019-11-29 13:29     ` Eli Zaretskii
2022-01-29 17:03       ` Lars Ingebrigtsen
2022-01-29 17:07         ` Eli Zaretskii
2022-01-29 17:09           ` Lars Ingebrigtsen
  -- strict thread matches above, loose matches on Subject: below --
2015-08-22  4:30 steckerhalter

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).