aboutsummaryrefslogtreecommitdiff
path: root/branches/0.6/lib
diff options
context:
space:
mode:
Diffstat (limited to 'branches/0.6/lib')
-rw-r--r--branches/0.6/lib/common.sh35
1 files changed, 20 insertions, 15 deletions
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