From 6ebf28b2bd4aaf32545171565149c5b4e2565985 Mon Sep 17 00:00:00 2001 From: rudson Date: Sun, 10 Jun 2007 15:24:59 +0000 Subject: mkbuild-0.9.1, createpkg-1.0.5.3 e adição de eecho e color_select a common.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@385 04377dda-e619-0410-9926-eae83683ac58 --- branches/0.6/lib/common.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'branches/0.6/lib/common.sh') diff --git a/branches/0.6/lib/common.sh b/branches/0.6/lib/common.sh index d7ec5d7..e4ff2ff 100644 --- a/branches/0.6/lib/common.sh +++ b/branches/0.6/lib/common.sh @@ -261,6 +261,7 @@ function eval_config { # createpkg and mkbuild section SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/slackbuilds`" MAKEPKG_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplaret/binaries`" + SOURCE_DIR="`eval_parameter SOURCE_DIR /var/sources`" REMOVE_OLD_PACKAGE="`eval_boolean_parameter REMOVE_OLD_PACKAGE 1`" MOVE_BIN_PACKAGE="`eval_boolean_parameter MOVE_BIN_PACKAGE 1`" # ---------------------------------------------------------------- @@ -719,3 +720,47 @@ function slash { } +function color_select { + + # Select color mode: gray, color or none (*) + # commun - Communication + # messag - Commum messages + # error - Error messages + # normal - turn off color + case "$1" in + 'gray') + commun="\033[37;1m" + messag="\033[37;1m" + error="\033[30;1m" + alert="\033[37m" + normal="\033[m" + ;; + 'color') + commun="\033[34;1m" # green + messag="\033[32;1m" # blue + error="\033[31;1m" # red + alert="\033[33;1m" # yellow + normal="\033[m" # normal + ;; + *) + commun="" + messag="" + error="" + alert="" + normal="" + ;; + esac + +} + + +function eecho { + + # echoes a message + # usage: eecho + # message-type can be: commun, messag, error, normal + + echo -e "${1}${2}${normal}" + +} + -- cgit v1.2.3