]> git.pld-linux.org Git - packages/rc-scripts.git/blob - rc-scripts-color.patch
- small fix CRED -> CFAIL in progress functions
[packages/rc-scripts.git] / rc-scripts-color.patch
1 diff -urN rc-scripts-0.4.0.9-orig/rc.d/init.d/functions rc-scripts-0.4.0.9/rc.d/init.d/functions
2 --- rc-scripts-0.4.0.9-orig/rc.d/init.d/functions       2004-02-06 23:36:29.000000000 +0100
3 +++ rc-scripts-0.4.0.9/rc.d/init.d/functions    2004-04-27 22:21:37.842160272 +0200
4 @@ -9,6 +9,7 @@
5  #              Marek Obuchowicz <elephant@pld-linux.org>
6  #              Arkadiusz Mi¶kiewicz <misiek@pld-linux.org>
7  #              Micha³ Kochanowicz <mkochano@pld-linux.org>
8 +#              £ukasz Pawelczyk <havner@pld-linux.org>
9  
10  # First set up a default search path.
11  export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
12 @@ -16,7 +17,32 @@
13  # Set defaults
14  INIT_COL=67
15  
16 +# Set colors
17 +RED=1
18 +GREEN=2
19 +YELLOW=3
20 +BLUE=4
21 +MAGENTA=5
22 +CYAN=6
23 +WHITE=7
24 +NORMAL=9
25 +# Bold definition (second parameter to termput setaf)
26 +BOLD=1
27 +NOBOLD=0
28 +# Default colors
29 +CBRACKETS="$CYAN"      # brackets [ ] color
30 +CDONE="$GREEN"         # DONE and WORK color
31 +CBUSY="$MAGENTA"       # BUSY color
32 +CFAIL="$RED"           # FAIL and DIED color
33 +CPOWEREDBY="$CYAN"     # "Powered by" color
34 +CPLD="$GREEN"          # "PLD Linux Distribution" color
35 +CI="$RED"              # Capital I color (press I to enter interactive startup)
36 +CRESMAN="$GREEN"       # "Resource Manager" color
37 +CHARS=""               # Characters displayed on the begining of show line
38 +CCHARS="$NORMAL"       # Color of these characters (look at /etc/sysconfig/init-colors.gentoo example)
39 +
40  # Source configuration if available - may override default values
41 +[ -r /etc/sysconfig/init-colors ] && . /etc/sysconfig/init-colors
42  [ -r /etc/sysconfig/system ] && . /etc/sysconfig/system
43  [ -r /etc/sysconfig/bootsplash ] && . /etc/sysconfig/bootsplash
44  
45 @@ -116,10 +142,12 @@
46                         echo -ne "\033[0K"
47                         ;;
48                   setaf)
49 -                       is_yes "$COLOR_INIT" && echo -ne "\033[0;3${2}m"
50 +                       typeset ISBOLD
51 +                       if [ -n "$3" ]; then ISBOLD="$3"; else ISBOLD="$NOBOLD"; fi
52 +                       is_yes "$COLOR_INIT" && echo -ne "\033[${ISBOLD};3${2}m"
53                         ;;
54                   op)
55 -                       termput setaf 9
56 +                       termput setaf $NORMAL
57                         ;;
58                 esac
59         else
60 @@ -131,10 +159,11 @@
61                         tput "$@"
62                         ;;
63                   setaf)
64 -                       is_yes "$COLOR_INIT" && tput "$@"
65 +                       if [ "$3" == "1" ]; then tput bold; else tput sgr0; fi
66 +                       is_yes "$COLOR_INIT" && tput setaf "$2"
67                         ;;
68                   op)
69 -                       tput setaf 9
70 +                       termput setaf $NORMAL
71                         ;;
72                 esac
73         fi
74 @@ -256,10 +285,16 @@
75         if is_yes "$FASTRC"; then
76                 echo -n "$INIT_DOTS"
77                 termput hpa 0
78 +               if [ -n "$CHARS" ]; then
79 +                       termput setaf $CCHARS ; echo -n "$CHARS"; termput op
80 +               fi
81                 printf "$@"
82                 termput hpa $INIT_COL
83         else
84                 text=$(nls "$@")
85 +               if [ -n "$CHARS" ]; then
86 +                       termput setaf $CCHARS ; echo -n "$CHARS"; termput op
87 +               fi
88                 echo -n "$text"
89                 awk "BEGIN { for (j=length(\"$text\"); j<$INIT_COL; j++) printf \".\" }"
90         fi
91 @@ -272,14 +307,14 @@
92  progress()
93  {
94         typeset COLOR
95 -       if [ -n "$2" ]; then COLOR="$2"; else COLOR="2"; fi
96 +       if [ -n "$2" ]; then COLOR="$2"; else COLOR="$CDONE"; fi
97         deltext
98 -       echo -n "$(termput setaf 6)[$(termput setaf "$COLOR") $(nls --nls-domain rc-scripts "$1") $(termput setaf 6)]$(termput op)"
99 +       echo -n "$(termput setaf $CBRACKETS)[$(termput setaf $COLOR) $(nls --nls-domain rc-scripts "$1") $(termput setaf $CBRACKETS)]$(termput op)"
100  }
101  
102  busy()
103  {
104 -       progress "BUSY" 5
105 +       progress "BUSY" "$CBUSY"
106  }
107  
108  ok()
109 @@ -296,14 +331,14 @@
110  
111  fail()
112  {
113 -       progress "FAIL" 1
114 +       progress "FAIL" "$CFAIL"
115         echo
116         return 1
117  }
118  
119  died()
120  {
121 -       progress "DIED" 1
122 +       progress "DIED" "$CFAIL"
123         echo
124         return 1
125  }
126 diff -urN rc-scripts-0.4.0.9-orig/rc.d/rc rc-scripts-0.4.0.9/rc.d/rc
127 --- rc-scripts-0.4.0.9-orig/rc.d/rc     2004-02-06 23:36:29.000000000 +0100
128 +++ rc-scripts-0.4.0.9/rc.d/rc  2004-04-27 20:52:23.076606016 +0200
129 @@ -142,9 +142,9 @@
130  
131  
132  # Say something ;)
133 -af2=$(termput setaf 2)
134 -af6=$(termput setaf 6)
135 -af7=$(termput setaf 7)
136 +af2=$(termput setaf $CRESMAN)
137 +af6=$(termput setaf $CBRACKETS)
138 +af7=$(termput op)
139  text="$(termput op)$(nls '%sResource Manager: %sEntering runlevel number' "$af2" "$af7")"
140  text_size="$(nls '%sResource Manager: %sEntering runlevel number' "" "")"
141  resp_size="$(nls 'DONE')"
142 diff -urN rc-scripts-0.4.0.9-orig/rc.d/rc.sysinit rc-scripts-0.4.0.9/rc.d/rc.sysinit
143 --- rc-scripts-0.4.0.9-orig/rc.d/rc.sysinit     2004-02-06 23:36:29.000000000 +0100
144 +++ rc-scripts-0.4.0.9/rc.d/rc.sysinit  2004-04-27 20:52:31.874268568 +0200
145 @@ -85,9 +85,9 @@
146  [ -e /proc/splash ] && is_no "$BOOT_SPLASH" && echo "0" > /proc/splash
147                                     
148  # Print welcome message
149 -nls "\t\t\t%sPowered by %sPLD Linux Distribution%s" "$(termput setaf 6)" "$(termput setaf 2)" "$(termput setaf 7)"
150 +nls "\t\t\t%sPowered by %sPLD Linux Distribution%s" "$(termput setaf $CPOWEREDBY)" "$(termput setaf $CPLD)" "$(termput op)"
151  if is_yes "$PROMPT"; then
152 -       nls -n "\t\t  Press %sI%s to enter interactive startup" "$(termput setaf 1)" "$(termput setaf 7)"
153 +       nls -n "\t\t  Press %sI%s to enter interactive startup" "$(termput setaf $CI)" "$(termput op)"
154         echo
155         sleep 1
156  fi
157 diff -urN rc-scripts-0.4.0.9-orig/sysconfig/init-colors.gentoo rc-scripts-0.4.0.9/sysconfig/init-colors.gentoo
158 --- rc-scripts-0.4.0.9-orig/sysconfig/init-colors.gentoo        1970-01-01 01:00:00.000000000 +0100
159 +++ rc-scripts-0.4.0.9/sysconfig/init-colors.gentoo     2004-04-27 22:22:11.272078152 +0200
160 @@ -0,0 +1,12 @@
161 +# Gentoo colors, copy this file as: /etc/sysconfig/init-colors, or just make a symlink
162 +
163 +CBRACKETS="$BLUE $BOLD"                # brackets [ ] color
164 +CDONE="$GREEN $BOLD"           # DONE and WORK color
165 +CBUSY="$MAGENTA $BOLD"         # BUSY color
166 +CFAIL="$RED $BOLD"             # FAIL and DIED color
167 +CPOWEREDBY="$BLUE $BOLD"       # "Powered by" color
168 +CPLD="$GREEN $BOLD"            # "PLD Linux Distribution" color
169 +CI="$RED $BOLD"                        # Capital I color (press I to enter interactive startup)
170 +CRESMAN="$GREEN $BOLD"         # "Resource Manager" color
171 +CHARS=" * "                    # Characters displayed on the begining of show line
172 +CCHARS="$GREEN $BOLD"          # Color of these characters
173 diff -urN rc-scripts-0.4.0.9-orig/sysconfig/init-colors.plddefault rc-scripts-0.4.0.9/sysconfig/init-colors.plddefault
174 --- rc-scripts-0.4.0.9-orig/sysconfig/init-colors.plddefault    1970-01-01 01:00:00.000000000 +0100
175 +++ rc-scripts-0.4.0.9/sysconfig/init-colors.plddefault 2004-04-27 22:25:10.501831088 +0200
176 @@ -0,0 +1,13 @@
177 +# Default PLD colors. You don't need to copy it as /etc/sysconfig/init-colors
178 +# they are included in /etc/rc.d/init.d/functions
179 +
180 +CBRACKETS="$CYAN"      # brackets [ ] color
181 +CDONE="$GREEN"         # DONE and WORK color
182 +CBUSY="$MAGENTA"       # BUSY color
183 +CFAIL="$RED"           # FAIL and DIED color
184 +CPOWEREDBY="$CYAN"     # "Powered by" color
185 +CPLD="$GREEN"          # "PLD Linux Distribution" color
186 +CI="$RED"              # Capital I color (press I to enter interactive startup)
187 +CRESMAN="$GREEN"       # "Resource Manager" color
188 +CHARS=""               # Characters displayed on the begining of show line
189 +CCHARS="$NORMAL"       # Color of these characters (look at /etc/sysconfig/init-colors.gentoo example)
190 diff -urN rc-scripts-0.4.0.9-orig/sysconfig/Makefile.am rc-scripts-0.4.0.9/sysconfig/Makefile.am
191 --- rc-scripts-0.4.0.9-orig/sysconfig/Makefile.am       2004-02-06 23:36:31.000000000 +0100
192 +++ rc-scripts-0.4.0.9/sysconfig/Makefile.am    2004-04-27 22:26:53.496173568 +0200
193 @@ -6,6 +6,8 @@
194  
195  sysconfig_DATA = \
196         clock \
197 +       init-colors.gentoo \
198 +       init-colors.plddefault \
199         hwprof \
200         system \
201         network \
202 diff -urN rc-scripts-0.4.0.9-orig/sysconfig/Makefile.in rc-scripts-0.4.0.9/sysconfig/Makefile.in
203 --- rc-scripts-0.4.0.9-orig/sysconfig/Makefile.in       2004-02-06 23:37:17.000000000 +0100
204 +++ rc-scripts-0.4.0.9/sysconfig/Makefile.in    2004-04-27 22:27:11.472440760 +0200
205 @@ -147,6 +147,8 @@
206  SUBDIRS = network-scripts interfaces hwprofiles
207  sysconfig_DATA = \
208         clock \
209 +       init-colors.gentoo \
210 +       init-colors.plddefault \
211         hwprof \
212         system \
213         network \
This page took 0.058245 seconds and 4 git commands to generate.