aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-02-02 23:04:07 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-02-02 23:04:07 +0000
commitc7ef9143d86d5aaed70a011bfcc52627fe4203cc (patch)
treeea89b5a5e4c5dde74edf0d33365c9c52c7bc03fd
parent9a016be11b177349501389990193a3ed8cf030e0 (diff)
downloadsimplepkg-c7ef9143d86d5aaed70a011bfcc52627fe4203cc.tar.gz
simplepkg-c7ef9143d86d5aaed70a011bfcc52627fe4203cc.tar.bz2
attempting to fix #33
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@790 04377dda-e619-0410-9926-eae83683ac58
-rwxr-xr-xtrunk/src/mkbuild25
1 files changed, 25 insertions, 0 deletions
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index 2c40aa5..a61a059 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -104,6 +104,8 @@ ${red}DESCRIPTION${normal}
edit a mkbuild
${red}-wc${normal}, ${red}--working-copy${normal}
create an unversioned mkbuild working copy
+ ${red}--get-param-copy${normal}
+ get a parameter from a given mkbuild
${red}EXAMPLES${normal}
${red}mkbuild -sa pyrex.mkbuild${normal}
@@ -242,6 +244,12 @@ function set_parameters {
ACTION='working_copy'
break # we need to break otherwise specific arguments are evalued
;;
+ '--get-param')
+ # Get parameter for a given mkbuild
+ set_mkbuild_name $2
+ ACTION='get_param'
+ break # we need to break otherwise specific arguments are evalued
+ ;;
'-d'|'--debug')
# Debug mode
set -x
@@ -1706,6 +1714,19 @@ function working_copy {
}
+function get_param {
+
+ # get a parameter from a mkbuild file
+ # usage: get_param <parameter>
+
+ local parameter="`echo $* | tr '[:lower:]' '[:upper:] | tr -d '"' | tr -d "'"'`"
+
+ if [ -e "$MKBUILD_NAME" ]; then
+ grep -e "\[\[$parameter\]\]" $MKBUILD_NAME | cut -d = -f 2 | tr -d '"' | tr -d "'"
+ fi
+
+}
+
# ----------------------------------------------------------------
#=============================
@@ -1811,6 +1832,10 @@ case $ACTION in
'working_copy')
working_copy
;;
+ 'get_param')
+ shift 2
+ get_param $*
+ ;;
esac
# Clear temporary files