diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-15 13:57:06 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-16 22:12:40 -0600 |
commit | 5c72f37618b77e7c7ebcab2c998e7be468c34e02 (patch) | |
tree | 4fbf1ade2ae14e59a9c65941cee4feaadbb324a8 /db-functions | |
parent | 9ea7be252eb359fa8d42eb74897b216158736f56 (diff) |
db-functions: use common.sh
Diffstat (limited to 'db-functions')
-rw-r--r-- | db-functions | 58 |
1 files changed, 7 insertions, 51 deletions
diff --git a/db-functions b/db-functions index 01629bc..523e872 100644 --- a/db-functions +++ b/db-functions @@ -24,57 +24,13 @@ if [ -n "${SVNUSER}" ]; then fi LOCKS=() -# check if messages are to be printed using color -unset ALL_OFF BOLD BLUE GREEN RED YELLOW -if [[ -t 2 ]]; then - ALL_OFF="$(tput sgr0)" - BOLD="$(tput bold)" - BLUE="${BOLD}$(tput setaf 4)" - GREEN="${BOLD}$(tput setaf 2)" - RED="${BOLD}$(tput setaf 1)" - YELLOW="${BOLD}$(tput setaf 3)" -fi -readonly ALL_OFF BOLD BLUE GREEN RED YELLOW - -plain() { - local mesg=$1; shift - printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" -} - -msg() { - local mesg=$1; shift - printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" -} - -msg2() { - local mesg=$1; shift - printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" -} - -warning() { - local mesg=$1; shift - printf "${YELLOW}==> WARNING:${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} - -error() { - local mesg=$1; shift - printf "${RED}==> ERROR${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} - -## -# usage : in_array( $needle, $haystack ) -# return : 0 - found -# 1 - not found -## -in_array() { - local needle=$1; shift - [[ -z $1 ]] && return 1 # Not Found - local item - for item in "$@"; do - [[ $item = $needle ]] && return 0 # Found - done - return 1 # Not Found -} +# Used: plain, msg, msg2, warning, error, in_array +# Overwritten: get_full_version, +# cleanup, abort, die +# Ignored: stat_busy, stat_done, +# setup_workdir, trab_abort, trap_exit, +# lock, slock, lock_close +. $(librelib common) ## # usage : get_full_version( $epoch, $pkgver, $pkgrel ) |