all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Andrii Kolomoiets <andreyk.mad@gmail.com>
Cc: 59684@debbugs.gnu.org
Subject: bug#59684: 29.0.50; [PATCH] package.el: Insert news for installed packages only
Date: Tue, 29 Nov 2022 21:06:33 +0000	[thread overview]
Message-ID: <87mt89bhd2.fsf@posteo.net> (raw)
In-Reply-To: <m21qplzoob.fsf@gmail.com> (Andrii Kolomoiets's message of "Tue,  29 Nov 2022 18:54:44 +0200")

Andrii Kolomoiets <andreyk.mad@gmail.com> writes:

> Hi,
>
> In some folder, e.g. "/tmp":
> 1. Create folder named "news"
> 2. emacs -Q
> 3. M-x list-packages
> 4. RET on any available not installed package
>
> This will produce "Read error: Is a directory, /tmp/news" message.
>
> In GNU Emacs 29.0.50
> Repository revision: 2772ebe3667f28cefd0d6134204ce6a3c7a8c323
> Repository branch: master
>
> Adding news to package description was introuced in
> dd98fedd0c7f27bfba046d761042c19181cb461d
>
> Adding Philip to Cc as the author of the original commit.
>
> Attached patch solves issue by checking that:
> 1. pkg-dir is not nil
> 2. pkg-dir is not 'builtin
> 3. "news" is a regular file

This sounds good.

> From 9bd185609643ec861b02b4327295bb6db3b82974 Mon Sep 17 00:00:00 2001
> From: muffinmad <andreyk.mad@gmail.com>
> Date: Mon, 28 Nov 2022 23:09:59 +0200
> Subject: [PATCH] Insert news for installed packages only
>
> * lisp/emacs-lisp/package.el (describe-package-1): Check package is
> installed and "news" is a regular file.
> ---
>  lisp/emacs-lisp/package.el | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index 8d44fae30a0..f722eb8fae9 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -2696,8 +2696,10 @@ describe-package-1
>           (signed (if desc (package-desc-signed desc)))
>           (maintainer (cdr (assoc :maintainer extras)))
>           (authors (cdr (assoc :authors extras)))
> -         (news (and-let* ((file (expand-file-name "news" pkg-dir))
> -                          ((file-readable-p file)))
> +         (news (and-let* (pkg-dir
> +                          ((not built-in))
> +                          (file (expand-file-name "news" pkg-dir))
> +                          ((file-regular-p file)))

Shouldn't we keep `file-readable-p'?

>                   file)))
>      (when (string= status "avail-obso")
>        (setq status "available obsolete"))





  reply	other threads:[~2022-11-29 21:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 16:54 bug#59684: 29.0.50; [PATCH] package.el: Insert news for installed packages only Andrii Kolomoiets
2022-11-29 21:06 ` Philip Kaludercic [this message]
2022-11-29 21:16   ` Andrii Kolomoiets
2022-11-29 21:25     ` Philip Kaludercic
2022-11-29 21:38       ` Andrii Kolomoiets
2022-11-30 19:53         ` Philip Kaludercic

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=87mt89bhd2.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=59684@debbugs.gnu.org \
    --cc=andreyk.mad@gmail.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.