Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 310121 Details for
Bug 413577
app-portage/gentoolkit: eread - provide basic sorting options
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for eread (script and manual page)
0001-Extend-eread-to-allow-sorting-bug-413577.patch (text/plain), 2.35 KB, created by
SÅ‚awomir Nizio
on 2012-04-25 22:52:59 UTC
(
hide
)
Description:
patch for eread (script and manual page)
Filename:
MIME Type:
Creator:
SÅ‚awomir Nizio
Created:
2012-04-25 22:52:59 UTC
Size:
2.35 KB
patch
obsolete
>From c0996cd7c6d88486dfdaafb61b518134e4371fa2 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?S=C5=82awomir=20Nizio?= <slawomir.nizio@sabayon.org> >Date: Thu, 26 Apr 2012 00:50:57 +0200 >Subject: [PATCH] Extend eread to allow sorting (bug 413577). > >--- > bin/eread | 36 ++++++++++++++++++++++++++++++++++-- > man/eread.1 | 13 +++++++++++++ > 2 files changed, 47 insertions(+), 2 deletions(-) > >diff --git a/bin/eread b/bin/eread >index 7d0a970..381a8ed 100755 >--- a/bin/eread >+++ b/bin/eread >@@ -5,6 +5,7 @@ > # > # Author: Donnie Berkholz <spyderous@gentoo.org> > # Updated by: Uwe Klosa <uwe.klosa@gmail.com> >+# Updated by: Slawomir Nizio <slawomir.nizio@sabayon.org> > > # Get prefix > EPREFIX=${EPREFIX:-$(portageq envvar EPREFIX)} >@@ -30,9 +31,34 @@ fi > # Set up select prompt > PS3="Choice? " > >+SORT=${EREAD_SORT_ORDER} >+ >+find_unsorted() { >+ find . -type f | sed -e "s:\./::g" >+} >+find_by_name() { >+ find . -type f | sort | sed -e "s:\./::g" >+} >+find_by_time() { >+ find . -type f | awk -F: '{print $3,$1":"$2":"$3}' | sort \ >+ | awk '{print $2}' | sed -e "s:\./::g" >+} >+find_files() { >+ case ${SORT} in >+ alphabet) >+ find_by_name >+ ;; >+ time) >+ find_by_time >+ ;; >+ *) >+ find_unsorted >+ ;; >+ esac >+} >+ > select_loop() { >- ANY_FILES=$(find . -type f) >- ANY_FILES=$(echo ${ANY_FILES} | sed -e "s:\./::g") >+ ANY_FILES=$(find_files) > > if [[ -z ${ANY_FILES} ]]; then > echo "No log items to read" >@@ -51,6 +77,12 @@ select_loop() { > QUIT="yes" > break > ;; >+ a) >+ SORT="alphabet" >+ ;; >+ t) >+ SORT="time" >+ ;; > *) > if [ -f "$FILE" ]; then > ${PAGER} ${FILE} >diff --git a/man/eread.1 b/man/eread.1 >index 5e18214..b96892e 100644 >--- a/man/eread.1 >+++ b/man/eread.1 >@@ -8,5 +8,18 @@ eread > .SH "DESCRIPTION" > .LP > This tool is used to display and manage ELOG files produced by portage version 2.1 and higher. >+.SH "USAGE" >+.LP >+You can use the following commands: >+.TP >+.B "q" >+Quit >+.TP >+.B "a" >+Sort alphabetically >+.TP >+.B "t" >+Sort by date > .SH "ENVIRONMENT VARIABLES" > The eread utility uses the PAGER environment variable to display the ELOG files. If the variable is not set, it defaults to /usr/bin/less. >+Another environment variable is EREAD_SORT_ORDER which can be set to specify default sort order of ELOG files. Values \fBalphabet\fP and \fBtime\fP are recognized. If EREAD_SORT_ORDER is not set or has another value, the output is unsorted. >-- >1.7.8.4 >
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 413577
:
310121
|
310123
|
310131