Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 463898 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]
pager support patch
pager.patch (text/plain), 1.84 KB, created by
Teika kazura
on 2017-02-16 01:41:28 UTC
(
hide
)
Description:
pager support patch
Filename:
MIME Type:
Creator:
Teika kazura
Created:
2017-02-16 01:41:28 UTC
Size:
1.84 KB
patch
obsolete
>commit fac076363a77fb8326f0acf6dcdaad74d4a0ea6c >Author: Teika kazura <teika@gmx.com> >Date: Wed Feb 15 22:00:32 2017 +0900 > > 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 against 1.4.5 <= app-admin/eselct <= 1.4.8. > >diff --git a/modules/news.eselect b/modules/news.eselect >index 1c6a981..ad9e837 100644 >--- a/modules/news.eselect >+++ b/modules/news.eselect >@@ -274,7 +274,15 @@ 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}" || [[ ${i} -lt 1 || ${i} -gt ${#items[@]} ]] > then > write_warning_msg "Bad item number: ${i}" >@@ -349,6 +357,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}
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