outcommenting of some debugmessages

This commit is contained in:
mathias 2005-01-30 22:17:17 +00:00
parent 3053f230e6
commit 70fee59a9a

View file

@ -163,7 +163,7 @@ convertIcon(){
fi fi
if [ "$1" == "$2" ]; then if [ "$1" == "$2" ]; then
$ECHO "Files are in the same location: $1 == $2" >&2 # $VERBOSE "Files are in the same location: $1 == $2" >&2
# not really an error; just nothing to do. # not really an error; just nothing to do.
return 0; return 0;
fi fi
@ -172,7 +172,7 @@ convertIcon(){
# make sure it is an icon by checking if it has an extension # make sure it is an icon by checking if it has an extension
if [ "$BASENAME" == "${BASENAME%%.*}" ]; then if [ "$BASENAME" == "${BASENAME%%.*}" ]; then
$ECHO "File $1 does not have a filename extention." >&2 # $VERBOSE "File $1 does not have a filename extention." >&2
return 1; return 1;
fi fi
@ -227,10 +227,10 @@ removePath(){
doSearchLoop(){ doSearchLoop(){
for ICONPATH in "$@"; do for ICONPATH in "$@"; do
#$ECHO ": $ICONPATH" >> $ICONMAPPING ## $VERBOSE ": $ICONPATH" >> $ICONMAPPING
[ -d "$ICONPATH" ] || continue [ -d "$ICONPATH" ] || continue
#echo -n "." #echo -n "."
# $ECHO ":: $ICONPATH/$temp_icon" >> $ICONMAPPING # # $VERBOSE ":: $ICONPATH/$temp_icon" >> $ICONMAPPING
if [ -f "$ICONPATH/$temp_icon" ]; then if [ -f "$ICONPATH/$temp_icon" ]; then
echo "$ICONPATH/$temp_icon" echo "$ICONPATH/$temp_icon"
return 0; return 0;
@ -238,7 +238,7 @@ doSearchLoop(){
# remove extension # remove extension
iconNOext=${temp_icon%%.*} iconNOext=${temp_icon%%.*}
[ -d "$ICONPATH" ] && for ICONEXT in .xpm .png .gif ; do [ -d "$ICONPATH" ] && for ICONEXT in .xpm .png .gif ; do
#$ECHO "::: $ICONPATH/$iconNOext$ICONEXT" >> $ICONMAPPING ## $VERBOSE "::: $ICONPATH/$iconNOext$ICONEXT" >> $ICONMAPPING
if [ -f "$ICONPATH/$iconNOext$ICONEXT" ]; then if [ -f "$ICONPATH/$iconNOext$ICONEXT" ]; then
echo "$ICONPATH/$iconNOext$ICONEXT" echo "$ICONPATH/$iconNOext$ICONEXT"
return 0; return 0;
@ -254,7 +254,7 @@ doSearch(){
# remove '(' from '(fluxbox ...) | ...' # remove '(' from '(fluxbox ...) | ...'
local execname="${1//(}" local execname="${1//(}"
local temp_icon="$2" local temp_icon="$2"
$ECHO "# Searching for icon $temp_icon for $execname" >> $ICONMAPPING # $VERBOSE "# Searching for icon $temp_icon for $execname" >> $ICONMAPPING
# check in $ICONMAPPING before searching directories # check in $ICONMAPPING before searching directories
entry_icon=`grep -m 1 "^\"${execname}\"" $ICONMAPPING | grep -o '<.*>'` entry_icon=`grep -m 1 "^\"${execname}\"" $ICONMAPPING | grep -o '<.*>'`
@ -280,7 +280,7 @@ searchForIcon(){
# remove '&' and everything after it # remove '&' and everything after it
entry_exec="${1%%&*}" entry_exec="${1%%&*}"
entry_icon="$2" entry_icon="$2"
$ECHO "searchForIcon \"$entry_exec\" \"$entry_icon\"" >&2 # $VERBOSE "searchForIcon \"$entry_exec\" \"$entry_icon\"" >&2
# get the basename and parameters of entry_exec -- no path # get the basename and parameters of entry_exec -- no path
entry_exec=`removePath "${entry_exec}"` entry_exec=`removePath "${entry_exec}"`
@ -327,7 +327,7 @@ searchForIcon(){
if ! grep -q -m 1 "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>" $ICONMAPPING 2> /dev/null; then if ! grep -q -m 1 "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>" $ICONMAPPING 2> /dev/null; then
echo -e "\"${entry_exec}\" \t <${entry_icon}>" >> $ICONMAPPING echo -e "\"${entry_exec}\" \t <${entry_icon}>" >> $ICONMAPPING
else else
$ECHO "# mapping already exists for ${entry_exec}" >> $ICONMAPPING : echo "# mapping already exists for ${entry_exec}" >> $ICONMAPPING
fi fi
else else
echo "# No icon file found for $entry_exec" >> $ICONMAPPING echo "# No icon file found for $entry_exec" >> $ICONMAPPING
@ -336,9 +336,9 @@ searchForIcon(){
toSingleLine(){ echo "$@"; } toSingleLine(){ echo "$@"; }
createIconMapping(){ createIconMapping(){
$ECHO "# creating `date`" >> $ICONMAPPING # $VERBOSE "# creating `date`" >> $ICONMAPPING
$ECHO "# using desktop files in $@" >> $ICONMAPPING # $VERBOSE "# using desktop files in $@" >> $ICONMAPPING
$ECHO "# searching for icons in `eval toSingleLine $OTHER_ICONPATHS`" >> $ICONMAPPING # $VERBOSE "# searching for icons in `eval toSingleLine $OTHER_ICONPATHS`" >> $ICONMAPPING
# need to determine when to use .fluxbox/icons/$execname.xpm over those listed in iconmapping # need to determine when to use .fluxbox/icons/$execname.xpm over those listed in iconmapping
for DIR in "$@" ; do for DIR in "$@" ; do
if [ -d "$DIR" ]; then if [ -d "$DIR" ]; then
@ -367,11 +367,9 @@ createIconMapping(){
;; ;;
esac esac
done done
else
$ECHO not exists: $DIR >&2
fi fi
done done
$ECHO "# done `date`" >> $ICONMAPPING # $VERBOSE "# done `date`" >> $ICONMAPPING
} }
lookupIcon() { lookupIcon() {
@ -390,14 +388,14 @@ lookupIcon() {
#echo "grepping ${execname}" #echo "grepping ${execname}"
iconString=`grep -m 1 "^\"${execname}\"" $ICONMAPPING | grep -o '<.*>'` iconString=`grep -m 1 "^\"${execname}\"" $ICONMAPPING | grep -o '<.*>'`
$ECHO "lookupIcon $execname, $iconString" >&2 # $VERBOSE "lookupIcon $execname, $iconString" >&2
if [ -z "$iconString" ] ; then if [ -z "$iconString" ] ; then
iconString=`grep -m 1 "^\"${execname%% *}" $ICONMAPPING | grep -o '<.*>'` iconString=`grep -m 1 "^\"${execname%% *}" $ICONMAPPING | grep -o '<.*>'`
fi fi
if [ -z "$iconString" ] && [ -z "$PARSING_DESKTOP" ] ; then if [ -z "$iconString" ] && [ -z "$PARSING_DESKTOP" ] ; then
#$ECHO "lookupIcon: Searching ... should only be needed for icons not gotten from *.desktop (manual-created ones): $execname" >&2 ## $VERBOSE "lookupIcon: Searching ... should only be needed for icons not gotten from *.desktop (manual-created ones): $execname" >&2
searchForIcon "$execname" "$execname" searchForIcon "$execname" "$execname"
[ "$entry_icon" ] && iconString="<$entry_icon>" [ "$entry_icon" ] && iconString="<$entry_icon>"
fi fi
@ -1272,7 +1270,7 @@ for KDE_PREFIX in "${KDE_PREFIX}" /usr/local /usr/X11R6 /usr /opt "${PREFIX}"; d
done done
if [ -z "${INSTALL}" ]; then if [ -z "${INSTALL}" ]; then
[ -z "$ECHO" ] && ECHO=": echo" # for debugging # [ -z "$VERBOSE" ] && VERBOSE=": echo" # for debugging
FB_ICONDIR="$HOME/.fluxbox/icons" FB_ICONDIR="$HOME/.fluxbox/icons"
[ -d "$FB_ICONDIR" ] || mkdir "$FB_ICONDIR" [ -d "$FB_ICONDIR" ] || mkdir "$FB_ICONDIR"
ICONMAPPING="$HOME/.fluxbox/iconmapping" ICONMAPPING="$HOME/.fluxbox/iconmapping"
@ -1301,13 +1299,13 @@ if [ -z "${INSTALL}" ]; then
OTHER_ICONPATHS=`eval checkDirs $OTHER_ICONPATHS` OTHER_ICONPATHS=`eval checkDirs $OTHER_ICONPATHS`
OTHER_DESKTOP_PATHS=`eval checkDirs $OTHER_DESKTOP_PATHS` OTHER_DESKTOP_PATHS=`eval checkDirs $OTHER_DESKTOP_PATHS`
$ECHO "Using USER_DESKTOP_PATHS=\"$USER_DESKTOP_PATHS\" and USER_ICONPATHS=\"$USER_ICONPATHS\"" # $VERBOSE "Using USER_DESKTOP_PATHS=\"$USER_DESKTOP_PATHS\" and USER_ICONPATHS=\"$USER_ICONPATHS\""
$ECHO "Using OTHER_ICONPATHS=$OTHER_ICONPATHS" # $VERBOSE "Using OTHER_ICONPATHS=$OTHER_ICONPATHS"
$ECHO "Using OTHER_DESKTOP_PATHS=$OTHER_DESKTOP_PATHS" # $VERBOSE "Using OTHER_DESKTOP_PATHS=$OTHER_DESKTOP_PATHS"
$ECHO "Calling function: createIconMapping" # $VERBOSE "Calling function: createIconMapping"
eval createIconMapping $USER_DESKTOP_PATHS $OTHER_DESKTOP_PATHS eval createIconMapping $USER_DESKTOP_PATHS $OTHER_DESKTOP_PATHS
$ECHO "Done createIconMapping." # $VERBOSE "Done createIconMapping."
fi fi
# directory for the backgrounds # directory for the backgrounds