all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Steve Purcell <steve@sanityinc.com>
Cc: 26490@debbugs.gnu.org
Subject: bug#26490: 25.1; package-buffer-info is incorrectly case-insensitive
Date: Sat, 28 Sep 2019 12:55:09 +0200	[thread overview]
Message-ID: <CADwFkm=NkdSTjp+kOmPu2rbyCbLCiDPNMLAP+1DSVmnOK-L80A@mail.gmail.com> (raw)
In-Reply-To: <751C9864-CA4C-47AC-9CBF-43C676D40B00@sanityinc.com>

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

Steve Purcell <steve@sanityinc.com> writes:

> >> Nonetheless, it has been part of the format expected by package.el for years.
> >>
> >> Making package.el more permissive over time can lead to problems with packages
> >> in older Emacsen, a prime example being the recently-added
> >> backwards-incompatible support for version-less dependencies in the
> >> `Package-Requires` header: authors check their packages in a recent Emacs and
> >> then find that an older otherwise-compatible Emacs can’t even parse their
> >> package metadata.
> >
> > Sure, that can be a problem.  I think that means that we should not
> > (yet) encourage package developers to not use them in their packages.
> > But if we don't take a first step, we can never get rid of it.
>
> > At the end of the day, it's the job of package developers to maintain
> > backwards compatibility.  I don't see why this change would be any
> > different in that respect from the many other changes that we make
> > between releases.
>
> My point is that if a package file can’t even be parsed by an older Emacs
> version’s “package.el”, the user of that Emacs version will automatically get an
> obscure error when they try to install it, even if the the package author was
> helpful enough to add `(emacs “27”)` as a dependency to indicate
> incompatibility. That’s not something that the package author could reasonably
> foresee, and it feels avoidable by keeping the basic structure of required
> metadata stable and backwards compatible.

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.

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Don-t-refuse-to-install-packages-without-a-footer-li.patch --]
[-- Type: text/x-patch, Size: 2549 bytes --]

From 9c49666dc857000c838db4beff64a3b3484aa812 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Fri, 20 Sep 2019 19:18:03 +0200
Subject: [PATCH] Don't refuse to install packages without a "footer line"

* lisp/emacs-lisp/package.el (package-buffer-info): Don't signal an
error when the "footer line" is missing.  Warn only.  (Bug#26490)
* etc/NEWS: Announce it.
---
 etc/NEWS                   | 14 ++++++++++++++
 lisp/emacs-lisp/package.el |  8 +++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index f8322104d4..0cbbf6e693 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -942,6 +942,20 @@ it can't find the config file.
 
 ** Package
 
+*** Warn if "footer line" is missing, but still install package.
+package.el used to refuse to install a package without the so-called
+"footer line", which appears at the very end of the file:
+
+;;; FILENAME ends here
+
+package.el will now install packages without this line, but it will
+issue a warning.  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
+package data.  It is therefore recommended to keep this line.
+
 *** 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 ef0c5171de..5601e4d630 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1046,10 +1046,12 @@ 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.
+    ;; This warning was added in Emacs 27.1, and should be removed at
+    ;; the earliest in version 31.1.  The idea is to phase out the
+    ;; requirement for a "footer line" without unduly impacting users
+    ;; on earlier Emacs versions.  See Bug#26490 for more details.
     (unless (search-forward (concat ";;; " file-name ".el ends here"))
-      (error "Package lacks a terminating comment"))
+      (warn "Package lacks a terminating comment"))
     ;; Try to include a trailing newline.
     (forward-line)
     (narrow-to-region start (point))
-- 
2.20.1


  reply	other threads:[~2019-09-28 10:55 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 [this message]
2019-10-01 23:54       ` Basil L. Contovounesios
2019-10-04 12:48         ` Stefan Kangas
2019-10-20 14:16       ` Stefan Kangas
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

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

  git send-email \
    --in-reply-to='CADwFkm=NkdSTjp+kOmPu2rbyCbLCiDPNMLAP+1DSVmnOK-L80A@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=26490@debbugs.gnu.org \
    --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 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.