Hi All, i would like to use eselect news in my overlay. I setup everything and everything goes well, but i am missing simple function which will refresh news which i can do after layman -S. i know that i can do emerge --sync,emerge -p <package>, but i have in mind something lite. maybe 'emerge --news-refresh' and when i do 'eselect news list' i would like to see overlay name something like mvala@vala ~ $ eselect news list News items: [1] read gentoo 2009-04-18 Generation 1 Java Setup Deprecated [2] read gentoo 2009-07-02 kdeprefix and monolithic ebuilds issues [3] read myoverlay 2010-02-21 MySQL 5.1 unmasking and upgrade procedures Ciao Martin Reproducible: Always Actual Results: Doesn't have this functionality Expected Results: To have this functionality
I wonder if it wouldn't be layman's task to make sure that the files in /var/lib/gentoo/news/ are updated after a sync operation. Seems unnatural to require manual intervention for this. Adding layman's maintainers to CC.
(In reply to comment #1) > I wonder if it wouldn't be layman's task to make sure that the files in > /var/lib/gentoo/news/ are updated after a sync operation. Seems unnatural to > require manual intervention for this. > > Adding layman's maintainers to CC. Oki, But at least show overlay name in eselect news list would be nice.
Maybe it would be better <overlay name> News items: [1] read gentoo 2009-04-18 Generation 1 Java Setup Deprecated [2] read gentoo 2009-07-02 kdeprefix and monolithic ebuilds issues [3] read myoverlay 2010-02-21 MySQL 5.1 unmasking and upgrade procedures <overlay name 2> News items: [1] read gentoo 2009-04-18 Generation 1 Java Setup Deprecated [2] read gentoo 2009-07-02 kdeprefix and monolithic ebuilds issues [3] read myoverlay 2010-02-21 MySQL 5.1 unmasking and upgrade procedures
(In reply to comment #2) > Oki, But at least show overlay name in eselect news list would be nice. Problem is to fit all information into available space, so that it can be displayed in an 80 column terminal window: 4 item's number (e.g. [10]) 6 "unread" 23 repository name (longest currently in layman is "postgresql-experimental") 10 date (e.g. 2011-10-26) 44 title (maximum length allowed by GLEP 42) 10 five column separators, 2 blanks each --- 97
Is the news already available as mbox/maildir? Then you can let a MUA like Mutt do the rendering.
(In reply to comment #5) > Is the news already available as mbox/maildir? Then you can let a MUA like > Mutt do the rendering. "eselect news read --mbox <item>..." will output the news in mbox format. There's no information about the repository in the mail headers though.
Created attachment 290921 [details, diff] Patch for news.eselect @Martin: Can you test if this patch would suit your needs? It will display the overlay name in brackets before the item's title (but only for repositories other than "gentoo"). The necessary space is gained by shortening "read" and "unread" to " " and "N", respectively, which is a convention used by several mail and news readers. Also the overlay's name is truncated if it's longer than 8 characters.
(In reply to comment #7) > Also the overlay's name is truncated if it's longer than 8 characters. You can check COLUMNS environmental variable and not truncate repository name if it is not needed.
initial news reporting capability is in layman's vcs commit 9a74747e60f08a6f303d36d45ad9bb2ba828af42 So far layman will use emerge's display_news_notification(), when it becomes available you will be able to configure it to use pkgcore for displaying any news. This action will occur for any sync/add action by layman. For layman-2.0 api consumers they will be able toggle this feature off/on and also to supply a custom news reporting function if it is used for something other than a gentoo overlay. Currently, it will report all news items including any unread news from the gentoo repository. I am preparing a patch to emerge to accept and use a list of repos to report on. Thereby limiting the news reporting to the affected overlays For testing, please emerge layman-9999 and test please. These changes were quite simple and I would like to get a layman-2.0.0 final release out soon including this feature.
Created attachment 290949 [details, diff] optionally specify the repos to report the news for patch to optionally specify the repos to report the news for in display_news_notification() brian@big_daddy ~/Dev/git/portage $ source ./testpath brian@big_daddy ~/Dev/git/portage $ python Python 2.6.7 (r267:88850, Oct 5 2011, 16:14:42) [GCC 4.5.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from _emerge.actions import display_news_notification, load_emerge_config >>> from _emerge.actions import display_news_notification, load_emerge_config >>> settings, trees, mtimedb = load_emerge_config() >>> display_news_notification(trees[settings["ROOT"]]["root_config"], >>> display_news_notification(trees[settings["ROOT"]]["root_config"], {"news_repos": ['gentoo']}) * IMPORTANT: 3 news items need reading for repository 'gentoo'. * Use eselect news to read news items. >>> display_news_notification(trees[settings["ROOT"]]["root_config"], {"news_repos": ['gentoo-guis']}) >>>
(In reply to comment #0) > maybe 'emerge --news-refresh' I've named it 'emerge --check-news': http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d47cf3efc797024749727464487ec0f155212b88 (In reply to comment #10) > Created attachment 290949 [details, diff] > optionally specify the repos to report the news for There are new public functions that you can use here: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a7f9df6dac32d2efd31b1c84ce10981560913282
Ok, I've updated layman to use the new public news functions. It will for now use the old emerge actions functions as a fallback if the installed portage does not yet have them. The new news functions will also limit the news reporting to only the overlay(s) synced or added. The fallback method will report news for all repos. This also renders the portage patch I attached earlier as obsolete. It can be viewed at http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=ad38a35a994b32ea65df5395d78a9ffabe9773e4 It is also available now in layman-9999. The new portage functionality is also available now in portage-9999.
Created attachment 290971 [details, diff] Patch for news.eselect (In reply to comment #8) > You can check COLUMNS environmental variable and not truncate repository name > if it is not needed. Yeah, probably that's better. Also, overlays with long names are rather the exception. So let's simply truncate the whole line if it is too long. Updated patch attached.
I can confirm that everything is working. here is my output News items: [1] 2009-04-18 Generation 1 Java Setup Deprecated [2] 2009-07-02 kdeprefix and monolithic ebuilds issues [3] 2010-02-21 MySQL 5.1 unmasking and upgrade procedures [4] 2010-03-23 New desktop subprofiles for GNOME and KDE [5] 2010-03-25 Python 3.1 [6] 2010-08-01 --as-needed enabled in default profiles [7] 2011-05-22 Removal of kdeprefix support [8] 2011-08-28 Mesa r600 driver now defaults to gallium [9] 2011-10-15 Upgrade to libpng15 [10] N 2011-10-20 [saske] Upgrade to libpng15 on LXPLUS [11] N 2011-10-25 [saske] !!! DON'T upgrade Kernel upgrate to 3.1.0 !!! Any way i think that it would be nicer if we could have Overlay : gentoo News items: [1] 2009-04-18 Generation 1 Java Setup Deprecated [2] 2009-07-02 kdeprefix and monolithic ebuilds issues [3] 2010-02-21 MySQL 5.1 unmasking and upgrade procedures [4] 2010-03-23 New desktop subprofiles for GNOME and KDE [5] 2010-03-25 Python 3.1 [6] 2010-08-01 --as-needed enabled in default profiles [7] 2011-05-22 Removal of kdeprefix support [8] 2011-08-28 Mesa r600 driver now defaults to gallium [9] 2011-10-15 Upgrade to libpng15 Overlay = saske News items: [10] N 2011-10-20 [saske] Upgrade to libpng15 on LXPLUS [11] N 2011-10-25 [saske] !!! DON'T upgrade Kernel upgrate to 3.1.0 !!! Ciao Martin
(In reply to comment #14) > I can confirm that everything is working. In SVN trunk: <http://sources.gentoo.org/cgi-bin/viewvc.cgi/eselect?view=revision&revision=852> > Any way i think that it would be nicer if we could have > [example deleted] I disagree. The news items are consecutively numbered (they must be, because the number is used as a reference for other actions), so it seems natural to display them in one unbroken list. Besides, I doubt that it is possible to find a sorting order that will please everybody. For example, in bug 344655 chronological order was requested.
(In reply to comment #15) > (In reply to comment #14) > > I can confirm that everything is working. > > In SVN trunk: > <http://sources.gentoo.org/cgi-bin/viewvc.cgi/eselect?view=revision&revision=852> > > > Any way i think that it would be nicer if we could have > > [example deleted] > > I disagree. The news items are consecutively numbered (they must be, because > the number is used as a reference for other actions), so it seems natural to > display them in one unbroken list. > > Besides, I doubt that it is possible to find a sorting order that will please > everybody. For example, in bug 344655 chronological order was requested. In this case i agree. Thanks for this feature. I am happy now. Ciao Martin PS: Can i close it?
This is fixed in 2.1.10.32 and 2.2.0_alpha72.
This is included in eselect-1.3.