The count and read action of the news module of app-admin/eselect already support parameters to distinguish between all and new news items. I propose to add this ability to the list action as well. For example, this is useful when showing the news items in an update script or on shell login. I also think, that most ppl are only interested in the actual new news when calling the list action. Thus, the new parameter might also be set as default. Reproducible: Always
Created attachment 687252 [details, diff] eselect-news.patch That's a simple change. Please test attached patch.
(In reply to Till Schäfer from comment #0) > I also think, that most ppl are only interested in the actual new news when > calling the list action. Thus, the new parameter might also be set as > default. That's not going to happen, for reasons of consistency between modules. By the eselect developer guide, the list action lists all available items.
The patch works as expected. Thanks for the fast solution! I was wondering if instead of skipping unread items in the loop the line set -- $(find_items unread read) could be just adjusted to only find unread items in the first place. Am I missing something here? Is the numbering a problem in this case?
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/eselect.git/commit/?id=74aa11482d3ab7cdbe44b85027e5b8c20ce82bb4 commit 74aa11482d3ab7cdbe44b85027e5b8c20ce82bb4 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2021-02-19 13:31:07 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2021-02-19 13:31:07 +0000 news.eselect: Support "new" and "all" options in list action * modules/news.eselect (do_list): Recognise "new" and "all" options, bug 771075. (describe_list_options): New function. Bug: https://bugs.gentoo.org/771075 Signed-off-by: Ulrich Müller <ulm@gentoo.org> ChangeLog | 6 ++++++ modules/news.eselect | 21 +++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-)
(In reply to Till Schäfer from comment #3) > The patch works as expected. Thanks for the fast solution! Pushed to git. It may take some time until I'll make a new release. Feel free to ping again if that won't have happened by mid of March. > I was wondering if instead of skipping unread items in the loop the line > set -- $(find_items unread read) > could be just adjusted to only find unread items in the first place. Am I > missing something here? Is the numbering a problem in this case? That would list the first unread item as 1, and so on. The problem is that the read action doesn't know if the preceding list action was for all items or only for the new items (because eselect is stateless). Therefore we need the address in the complete list.
Fixed in eselect-1.4.18.