all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: steckerhalter <emacs@postmomentum.ch>
Cc: 21319@debbugs.gnu.org
Subject: bug#21319: `package-install-file' fails with CRLF (Windows) line endings
Date: Tue, 22 Oct 2019 16:50:44 +0200	[thread overview]
Message-ID: <CADwFkmm4k9q0dXtpMtANb2ir+3M+ed-YDhbqg1wDm-cy35+k=g@mail.gmail.com> (raw)
In-Reply-To: <CADwFkmkbRBJetUkfxZSKNx+Ce-x-efbGeDFL_yr8EiwiYp3sqg@mail.gmail.com>

Stefan Kangas <stefan@marxist.se> writes:

> steckerhalter <emacs@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





  reply	other threads:[~2019-10-22 14:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmm4k9q0dXtpMtANb2ir+3M+ed-YDhbqg1wDm-cy35+k=g@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=21319@debbugs.gnu.org \
    --cc=emacs@postmomentum.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.