unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Steve Purcell <steve@sanityinc.com>
Cc: 26490@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#26490: 25.1; package-buffer-info is incorrectly case-insensitive
Date: Sun, 20 Oct 2019 16:16:58 +0200	[thread overview]
Message-ID: <CADwFkmm7=FK=Ej_Pz_bHGy9-+HVaRuV=o0hNoNvo42=dXE9HrA@mail.gmail.com> (raw)
In-Reply-To: <CADwFkm=NkdSTjp+kOmPu2rbyCbLCiDPNMLAP+1DSVmnOK-L80A@mail.gmail.com>

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

Stefan Kangas <stefan@marxist.se> writes:

> I see your point.  How about issuing a warning instead?  That should
> be sufficiently discouraging for package authors, while also allowing
> us to drop this requirement at some point in the future.
>
> I've attached a patch which I believe would do this in a reasonable way.

Ping!  Does anyone have any objections to this change, or any
comments?  I've attached the latest version of the patch.

In summary, it makes it possible to install packages even if they are
missing the terminating ";; foo.el ends here" line.  Instead, we raise
a warning for such packages.

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Allow-installation-packages-without-a-footer-line.patch --]
[-- Type: application/octet-stream, Size: 2821 bytes --]

From cbad98f4ac8029e383255ff45395b5aa01935306 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Fri, 20 Sep 2019 19:18:03 +0200
Subject: [PATCH] Allow installation packages without a "footer line"

* lisp/emacs-lisp/package.el (package-buffer-info): Warn instead of
signaling an error when there is no "footer line".  This allows such
packages to be installed.  (Bug#26490)
* etc/NEWS: Announce it.
---
 etc/NEWS                   | 15 +++++++++++++++
 lisp/emacs-lisp/package.el | 11 ++++++++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 46ed40dfcb..a47c6098d4 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1030,6 +1030,21 @@ it can't find the config file.
 
 ** Package
 
+*** Allow installation of packages missing a "footer line".
+Previously, the package system refused to install a package without
+the so-called "footer line", which should appear at the very end of
+the file:
+
+;;; FILENAME ends here
+
+Emacs will now only issue a warning for such packages.  To avoid this
+warning, packages should keep the "footer line".
+
+Note that versions of Emacs older than 27.1 will not only refuse to
+install packages without such a line -- they will be unable to parse
+the package data.  It is therefore strongly recommended to keep this
+line, even if your package only supports Emacs 27.1 or later.
+
 *** Change of 'package-check-signature' for packages with multiple sigs
 In previous Emacsen, 't' checked that all signatures are valid.
 Now 't' only checks that at least one signature is valid and the new 'all'
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 20462064af..69ca658b81 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1082,10 +1082,15 @@ package-buffer-info
   (let ((file-name (match-string-no-properties 1))
         (desc      (match-string-no-properties 2))
         (start     (line-beginning-position)))
-    ;; The terminating comment format could be extended to accept a
-    ;; generic string that is not in English.
+    ;; Before version 27.1, it was not possible to install packages
+    ;; without a terminating comment.  We now only issue a warning.
+    ;; This warning should probably be around until at least Emacs
+    ;; version 32.1 or so, or possibly longer.  The idea is to phase
+    ;; out the requirement for a "footer line" without unduly
+    ;; impacting users on earlier Emacs versions.  (Bug#26490)
     (unless (search-forward (concat ";;; " file-name ".el ends here"))
-      (error "Package lacks a terminating comment"))
+      (lwarn '(package package-format) :warning
+             "Package lacks a terminating comment"))
     ;; Try to include a trailing newline.
     (forward-line)
     (narrow-to-region start (point))
-- 
2.23.0


  parent reply	other threads:[~2019-10-20 14:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14  0:44 bug#26490: 25.1; package-buffer-info is incorrectly case-insensitive Steve Purcell
2017-04-14  7:31 ` Eli Zaretskii
2017-04-14  9:12   ` Steve Purcell
2017-04-14 20:29 ` Glenn Morris
2017-04-14 23:02   ` Steve Purcell
2019-08-24  5:57 ` Stefan Kangas
2019-08-24  6:35   ` Steve Purcell
2019-09-28 10:55     ` Stefan Kangas
2019-10-01 23:54       ` Basil L. Contovounesios
2019-10-04 12:48         ` Stefan Kangas
2019-10-20 14:16       ` Stefan Kangas [this message]
2019-10-21 16:05         ` Stefan Monnier
2019-11-02  0:31           ` Stefan Kangas

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CADwFkmm7=FK=Ej_Pz_bHGy9-+HVaRuV=o0hNoNvo42=dXE9HrA@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=26490@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=steve@sanityinc.com \
    /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 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).