[pacman-dev] pacman-optimize updates

Dan McGee dpmcgee at gmail.com
Sat Jan 6 00:49:37 EST 2007


Another patch for cleanup purposes, and a better way to fix the
USECOLOR problem- use the user's setting. This should be applied
concurrently with the above changes; basically just move the sourcing
above the errror function, and use the new error function instead of
the old. This revised error function allows for a no-color choice.

-Dan

Index: pacman-optimize
===================================================================
RCS file: /home/cvs-pacman/pacman-lib/scripts/pacman-optimize,v
retrieving revision 1.5
diff -u -u -r1.5 pacman-optimize
--- pacman-optimize     3 Jan 2007 05:45:18 -0000       1.5
+++ pacman-optimize     6 Jan 2007 05:47:22 -0000
@@ -22,12 +22,17 @@

 myver='3.0.0'

+source /etc/rc.conf
+source /etc/rc.d/functions
+
 error() {
-       echo -e "\033[1;31m:: ERROR:\033[1;0m\033[1;1m$@\033[1;0m" >&2
+       if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then
+               echo -e "\033[1;31m:: ERROR:\033[1;0m \033[1;1m$@\033[1;0m" >&2
+       else
+               echo ":: ERROR: $@" >&2
+       fi
 }

-source /etc/rc.d/functions
-
 usage() {
        echo "pacman-optimize $myver"
        echo "usage: $0 [pacman_db_root]"




More information about the pacman-dev mailing list