|| return 1
}
-log_success_msg () {
+log_success_msg() {
printf " * $@\n"
}
-log_failure_msg () {
+log_failure_msg() {
if _have_tput ; then
RED="$("$TPUT" setaf 1)"
#NORMAL="$("$TPUT" op)"
fi
}
-log_warning_msg () {
+log_warning_msg() {
if _have_tput ; then
YELLOW="$("$TPUT" setaf 3)"
#NORMAL="$("$TPUT" op")"
fi
}
-log_warning_msg_nn () {
+log_warning_msg_nn() {
if _have_tput ; then
YELLOW="$("$TPUT" setaf 3)"
printf " ${BLUE}*${NORMAL} $@"
}
# int log_begin_message (char *message)
-log_begin_msg () {
+log_begin_msg() {
if [ "$#" -eq 0 ]; then
return 1
fi
printf " ${GREEN}*${NORMAL} $@\n"
}
-log_begin_msg_nn () {
+log_begin_msg_nn() {
if [ "$#" -eq 0 ]; then
return 1
fi
SUBMSG=" ${GREEN}-${NORMAL} "
# int log_end_message (int exitstatus)
-log_end_msg () {
+log_end_msg() {
# If no arguments were passed, return
[ "$#" -eq 0 ] && return 1
return ${retval}
}
-# Safer way to list the contents of a directory,
-# as it do not have the "empty dir bug".
-#
-# char *dolisting(param)
-#
-# print a list of the directory contents
-#
-# NOTE: quote the params if they contain globs.
-# also, error checking is not that extensive ...
-#
-dolisting() {
- local x
- local y
- local tmpstr
- local mylist
- local mypath="$*"
-
- if [ "${mypath%/\*}" != "${mypath}" ]
- then
- mypath="${mypath%/\*}"
- fi
-
- for x in ${mypath}
- do
- [ ! -e "${x}" ] && continue
-
- if [ ! -d "${x}" ] && ( [ -L "${x}" ] || [ -f "${x}" ] )
- then
- mylist="${mylist} $(ls "${x}" 2> /dev/null)"
- else
- [ "${x%/}" != "${x}" ] && x="${x%/}"
-
- cd "${x}"; tmpstr="$(ls)"
-
- for y in ${tmpstr}
- do
- mylist="${mylist} ${x}/${y}"
- done
- fi
- done
-
- printf "${mylist}\n"
-}
-
# char *add_suffix(char * configfile)
#
# Returns a config file name with the softlevel suffix