Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 631438 Details for
Bug 513470
app-admin/eselect: Use $PAGER on eselect news read
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to support PAGER for "eselect news read".
0001-eselect-1.4.16.patch (text/plain), 1.92 KB, created by
Teika kazura
on 2020-04-09 02:26:30 UTC
(
hide
)
Description:
Patch to support PAGER for "eselect news read".
Filename:
MIME Type:
Creator:
Teika kazura
Created:
2020-04-09 02:26:30 UTC
Size:
1.92 KB
patch
obsolete
>From 5a95ecaec756cc02a1c7493811c5f86bd7747a91 Mon Sep 17 00:00:00 2001 >From: Teika Kazura <teika@gmx.com> >Date: Thu, 9 Apr 2020 10:16:32 +0900 >Subject: [PATCH] eselect-1.4.16 > > Adds pager support for "$ eselect news read". > > Now the command "$ eselect news read" respects the environment variable PAGER. It is used only to show news items, not for e.g. messages like "no news is a good news". When stdin or stderr is not attached to the console, PAGER will not be used. > > The original code was written by "Teika kazura" <teika.gmx@com> (Swap the at-sign and the dot.) The commited version was contributed at Gentoo forum[1] by "steveL" [2]. The latter was chosen because of improvement in bash coding. > > [1] https://forums.gentoo.org/viewtopic.php?p=8028864#8028864, > [2] https://forums.gentoo.org/profile.php?mode=viewprofile&u=146493 > > The patch applies to 1.4.16. > >--- > modules/news.eselect | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >diff --git a/modules/news.eselect b/modules/news.eselect >index 15e5cb6..5817164 100644 >--- a/modules/news.eselect >+++ b/modules/news.eselect >@@ -284,7 +284,17 @@ do_read() { > && echo "No news is good news." > fi > >+ local tmp tmpdir tmpfiles=() >+ tmpdir=$(mktemp --tmpdir -d eselect.news.XXX) || die 'unable to create tmpdir' >+ >+ exec 3>&1 >+ > for i; do >+ tmp=$tmpdir/$i >+ tmpfiles+=("$tmp") >+ exec >"$tmp" >+ >+ > if is_number "${i}"; then > if (( i < 1 || i > n )); then > write_warning_msg "Bad item number: ${i}" >@@ -370,6 +380,16 @@ do_read() { > has ${repo} ${repos_upd} || repos_upd="${repos_upd} ${repo}" > done > >+ exec >&3 3>&- >+ if ((${#tmpfiles[*]} )); then >+ if [[ -n $PAGER ]] && [[ -t 0 && -t 2 ]]; then >+ $PAGER "${tmpfiles[@]}" >+ else >+ cat "${tmpfiles[@]}" >+ fi >+ fi >+ rm -fr "$tmpdir" >+ > # update lists of read/unread items > for repo in ${repos_upd}; do > write_item_list read ${repo} && write_item_list unread ${repo} >-- >2.24.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 513470
:
463898
| 631438