Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 137907
Collapse All | Expand All

(-)localepurge.orig/localepurge (-54 / +44 lines)
Lines 3-8 Link Here
3
# Deleting all locale files on system
3
# Deleting all locale files on system
4
# *not* listed in /etc/locale.nopurge
4
# *not* listed in /etc/locale.nopurge
5
5
6
set -e
7
6
LOCALEDIRS="/usr/share/locale /usr/local/share/locale /usr/kde/?.?/share/locale /opt/sun-jdk-*/jre/lib/locale /opt/sun-jre-bin-*/lib/locale /usr/lib/locale"
8
LOCALEDIRS="/usr/share/locale /usr/local/share/locale /usr/kde/?.?/share/locale /opt/sun-jdk-*/jre/lib/locale /opt/sun-jre-bin-*/lib/locale /usr/lib/locale"
7
MANPAGEDIRS="/usr/share/man /usr/man /usr/local/share/man /usr/kde/?.?/share/man /usr/kde/?.?/man /opt/sun-jdk-*/man /opt/sun-jre-bin-*/man"
9
MANPAGEDIRS="/usr/share/man /usr/man /usr/local/share/man /usr/kde/?.?/share/man /usr/kde/?.?/man /opt/sun-jdk-*/man /opt/sun-jre-bin-*/man"
8
LOCALELIST="/var/cache/localepurge/localelist"
10
LOCALELIST="/var/cache/localepurge/localelist"
Lines 11-46 Link Here
11
LOCALETOTAL=0
13
LOCALETOTAL=0
12
MANTOTAL=0
14
MANTOTAL=0
13
15
14
set -e
16
GOOD=$'\e[32;01m'
15
17
WARN=$'\e[33;01m'
16
if [ "$1" = "-debug" ] || [ "$1" = "-d" ] \
18
BAD=$'\e[31;01m'
17
    || [ "$2" = "-debug" ] || [ "$2" = "-d" ] \
19
NORMAL=$'\e[0m'
18
    || [ "$3" = "-debug" ] || [ "$3" = "-d" ] \
20
HILITE=$'\e[36;01m'
19
    || [ "$4" = "-debug" ] || [ "$4" = "-d" ] \
21
BRACKET=$'\e[34;01m'
20
    || [ "$5" = "-debug" ] || [ "$5" = "-d" ]; then
22
BOLD=$'\e[1m'
21
set -x
22
fi
23
23
24
if [ "`grep -x ^NOCOLOR /etc/locale.nopurge`" ] \
25
    || [ "$1" = "-nocolor" ] || [ "$1" = "-nc" ] \
26
    || [ "$2" = "-nocolor" ] || [ "$2" = "-nc" ] \
27
    || [ "$3" = "-nocolor" ] || [ "$3" = "-nc" ] \
28
    || [ "$4" = "-nocolor" ] || [ "$4" = "-nc" ] \
29
    || [ "$5" = "-nocolor" ] || [ "$5" = "-nc" ]; then
30
    NOCOLOR=yes
31
fi
32
33
if [[ ${NOCOLOR} == yes ]]; then
34
    unset GOOD WARN BAD NORMAL HILITE BRACKET BOLD
35
else
36
    GOOD=$'\e[32;01m'
37
    WARN=$'\e[33;01m'
38
    BAD=$'\e[31;01m'
39
    NORMAL=$'\e[0m'
40
    HILITE=$'\e[36;01m'
41
    BRACKET=$'\e[34;01m'
42
    BOLD=$'\e[1m'
43
fi
44
eerror () {
24
eerror () {
45
    echo -e " ${BAD}*${NORMAL} $*"
25
    echo -e " ${BAD}*${NORMAL} $*"
46
}
26
}
Lines 75-110 Link Here
75
version () {
55
version () {
76
    einfo "${BRACKET}[${NORMAL} ${GOOD}${VERSION}${NORMAL} ${BRACKET}]${NORMAL}"
56
    einfo "${BRACKET}[${NORMAL} ${GOOD}${VERSION}${NORMAL} ${BRACKET}]${NORMAL}"
77
}
57
}
78
if [ "$1" = "-help" ] || [ "$1" = "-h" ] \
79
    || [ "$2" = "-help" ] || [ "$2" = "-h" ] \
80
    || [ "$3" = "-help" ] || [ "$3" = "-h" ] \
81
    || [ "$4" = "-help" ] || [ "$4" = "-h" ] \
82
    || [ "$5" = "-help" ] || [ "$5" = "-h" ]; then
83
	ayuda
84
	exit 0
85
fi
86
87
if [ "$1" = "-version" ] \
88
    || [ "$2" = "-version" ]  \
89
    || [ "$3" = "-version" ]  \
90
    || [ "$4" = "-version" ]  \
91
    || [ "$5" = "-version" ] ; then
92
	version
93
	exit 0
94
fi
95
58
96
if [ "`grep -x ^SHOWFREEDSPACE /etc/locale.nopurge`" ]; then
59
if [ "`grep -x ^SHOWFREEDSPACE /etc/locale.nopurge`" ]; then
97
    SHOWFREEDSPACE=enabled
60
    SHOWFREEDSPACE=enabled
98
fi
61
fi
99
62
100
if [ "`grep -x ^VERBOSE /etc/locale.nopurge`" ] \
63
# We need to loop through for no color first, otherwise options that exit 
101
    || [ "$1" = "-verbose" ] || [ "$1" = "-v" ] \
64
# will make us ignore nocolor, so we might as well loop for debug first as well
102
    || [ "$2" = "-verbose" ] || [ "$2" = "-v" ] \
65
103
    || [ "$3" = "-verbose" ] || [ "$3" = "-v" ] \
66
for x in $@
104
    || [ "$4" = "-verbose" ] || [ "$4" = "-v" ] \
67
do
105
    || [ "$5" = "-verbose" ] || [ "$5" = "-v" ]; then
68
    if [ "$x" = "-debug" ] || [ "$x" = "-d" ]; then
106
    VERBOSE=enabled
69
        set -x
107
fi
70
    fi
71
72
    if [ "`grep -x ^NOCOLOR /etc/locale.nopurge`" ] || [ "$x" = "-nocolor" ] || [ "$x" = "-nc" ]; then
73
        unset GOOD WARN BAD NORMAL HILITE BRACKET BOLD
74
    fi
75
76
done
77
78
# Loop through the rest of the options
79
80
for x in $@
81
do
82
83
    if [ "`grep -x ^VERBOSE /etc/locale.nopurge`" ]  || [ "$x" = "-verbose" ] || [ "$x" = "-v" ]; then
84
        VERBOSE=enabled
85
    fi
86
87
    if [ "$x" = "-version" ] ; then
88
        version
89
	exit 0
90
    fi
91
92
    if [ "$x" = "-help" ] || [ "$x" = "-h" ]; then
93
	ayuda
94
	exit 0
95
    fi
96
97
done
108
98
109
# Do nothing and report why if no valid configuration file exists:
99
# Do nothing and report why if no valid configuration file exists:
110
100

Return to bug 137907