--- Begin Message ---
Subject: |
29.0.50; [PATCH] package.el: Insert news for installed packages only |
Date: |
Tue, 29 Nov 2022 18:54:44 +0200 |
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
0001-Insert-news-for-installed-packages-only.patch
Description: Text Data
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#59684: 29.0.50; [PATCH] package.el: Insert news for installed packages only |
Date: |
Wed, 30 Nov 2022 19:53:54 +0000 |
Andrii Kolomoiets <andreyk.mad@gmail.com> writes:
> Philip Kaludercic <philipk@posteo.net> writes:
>
>>>>> + ((file-regular-p file)))
>>>>
>>>> Shouldn't we keep `file-readable-p'?
>>>
>>> I think we should use `file-regular-p' so even if the pkg-dir will
>>> contain directory named "news" we will not try to insert it with
>>> `insert-file-contents'.
>>
>> I agree that `file-regular-p' is sensible, what I meant was using
>> `file-readable-p' in addition to that. But I guess that all in all,
>> this is a rare circumstance...
>
> Oh, right. Makes sense. I've updated the patch.
Thanks, I've pushed the change.
--- End Message ---