Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 413577 | Differences between
and this patch

Collapse All | Expand All

(-)a/bin/eread (-2 / +34 lines)
Lines 5-10 Link Here
5
#
5
#
6
# Author: Donnie Berkholz <spyderous@gentoo.org>
6
# Author: Donnie Berkholz <spyderous@gentoo.org>
7
# Updated by: Uwe Klosa <uwe.klosa@gmail.com>
7
# Updated by: Uwe Klosa <uwe.klosa@gmail.com>
8
# Updated by: Slawomir Nizio <slawomir.nizio@sabayon.org>
8
9
9
# Get prefix
10
# Get prefix
10
EPREFIX=${EPREFIX:-$(portageq envvar EPREFIX)}
11
EPREFIX=${EPREFIX:-$(portageq envvar EPREFIX)}
Lines 30-38 fi Link Here
30
# Set up select prompt
31
# Set up select prompt
31
PS3="Choice? "
32
PS3="Choice? "
32
33
34
SORT=${EREAD_SORT_ORDER}
35
36
find_unsorted() {
37
	find . -type f | sed -e "s:\./::g"
38
}
39
find_by_name() {
40
	find . -type f | sort | sed -e "s:\./::g"
41
}
42
find_by_time() {
43
	find . -type f | awk -F: '{print $3,$1":"$2":"$3}' | sort \
44
		| awk '{print $2}' | sed -e "s:\./::g"
45
}
46
find_files() {
47
	case ${SORT} in
48
		alphabet)
49
			find_by_name
50
			;;
51
		time)
52
			find_by_time
53
			;;
54
		*)
55
			find_unsorted
56
		;;
57
	esac
58
}
59
33
select_loop() {
60
select_loop() {
34
	ANY_FILES=$(find . -type f)
61
	ANY_FILES=$(find_files)
35
	ANY_FILES=$(echo ${ANY_FILES} | sed -e "s:\./::g")
36
62
37
	if [[ -z ${ANY_FILES} ]]; then
63
	if [[ -z ${ANY_FILES} ]]; then
38
		echo "No log items to read"
64
		echo "No log items to read"
Lines 51-56 select_loop() { Link Here
51
				QUIT="yes"
77
				QUIT="yes"
52
				break
78
				break
53
				;;
79
				;;
80
			a)
81
				SORT="alphabet"
82
				;;
83
			t)
84
				SORT="time"
85
				;;
54
			*)
86
			*)
55
				if [ -f "$FILE" ]; then
87
				if [ -f "$FILE" ]; then
56
					${PAGER} ${FILE}
88
					${PAGER} ${FILE}
(-)a/man/eread.1 (-1 / +13 lines)
Lines 8-12 eread Link Here
8
.SH "DESCRIPTION"
8
.SH "DESCRIPTION"
9
.LP 
9
.LP 
10
This tool is used to display and manage ELOG files produced by portage version 2.1 and higher.
10
This tool is used to display and manage ELOG files produced by portage version 2.1 and higher.
11
.SH "USAGE"
12
.LP
13
You can use the following commands:
14
.TP
15
.B "q"
16
Quit
17
.TP
18
.B "a"
19
Sort alphabetically
20
.TP
21
.B "t"
22
Sort by time
11
.SH "ENVIRONMENT VARIABLES"
23
.SH "ENVIRONMENT VARIABLES"
12
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.
24
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.
13
- 
25
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.

Return to bug 413577