From 22fad27c413ff4413d4a5273f228e2e00c8568ea Mon Sep 17 00:00:00 2001 From: rudson Date: Thu, 19 Jul 2007 15:11:57 +0000 Subject: createpkg-1.1.1; mkbuild-1.0.0 e common.sh update. Descrição das alterações na lista do grupo. 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@402 04377dda-e619-0410-9926-eae83683ac58 --- branches/0.6/lib/common.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'branches/0.6/lib') diff --git a/branches/0.6/lib/common.sh b/branches/0.6/lib/common.sh index 4e18dfa..67ab161 100644 --- a/branches/0.6/lib/common.sh +++ b/branches/0.6/lib/common.sh @@ -175,6 +175,18 @@ function eval_parameter { } +function set_constants { + + # Set common constants + # on/off + on=1 + off=0 + # yes/no + yes=1 + no=0 + +} + function eval_boolean_parameter { # get a boolean parameter from the configuration @@ -184,11 +196,17 @@ function eval_boolean_parameter { # get the value value="`eval_parameter $1 $2`" + convert_boolean $value + +} + +function convert_boolean { + # force case insensitiveness - value="`echo $value | tr '[:upper:]' '[:lower:]'`" + local value="`echo $1 | tr '[:upper:]' '[:lower:]'`" # convert it to wheter 0 or 1 - if [ "$value" == "yes" ] || [ "$value" == "1" ]; then + if [ "$value" == "yes" ] || [ "$value" == "1" ] || [ "$value" == "on" ]; then echo 1 else echo 0 @@ -257,19 +275,6 @@ function eval_config { # now we place "patches" on the top of ROOT_PRIORITY ROOT_PRIORITY="patches `echo $ROOT_PRIORITY | sed -e 's/patches//'`" - # ---------------------------------------------------------------- - # createpkg and mkbuild section - #MAKEPKG_REPOS="`eval_parameter MAKEPKG_REPOS /var/simplaret/repos`" - #SOURCE_DIR="`eval_parameter SOURCE_DIR /var/simplaret/sources`" - #SLACKBUILDS_DIR="`eval_parameter SLACKBUILDS_DIR /var/simplaret/slackbuilds`" - - #COLOR_MODE="`eval_parameter COLOR_MODE none`" - #CREATE_ARCH="`eval_parameter CREATE_ARCH i486`" - #CREATE_CLEANUP="`eval_parameter CREATE_CLEANUP 'yes'`" - - #REMOVE_OLD_PACKAGE="`eval_parameter REMOVE_OLD_PACKAGE off`" - #MOVE_BIN_PACKAGE="`eval_parameter MOVE_BIN_PACKAGE off`" - # ---------------------------------------------------------------- else echo $1 error: config file $CONFIG not found -- cgit v1.2.3