aboutsummaryrefslogtreecommitdiff
path: root/trunk/src
diff options
context:
space:
mode:
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-10-21 23:26:09 +0000
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>2007-10-21 23:26:09 +0000
commit0d5e3cee3bacba5e41898e599f189bb6ee0381c5 (patch)
tree0c733d1691fdcdd6ce51685b6aff1a495377fb57 /trunk/src
parent38ecbdc3e1d7bb4bda83538d3b0dfd00ac55f7e9 (diff)
downloadsimplepkg-0d5e3cee3bacba5e41898e599f189bb6ee0381c5.tar.gz
simplepkg-0d5e3cee3bacba5e41898e599f189bb6ee0381c5.tar.bz2
atualizações ao mkbuild e ao modelo .mkSlackBuild
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@450 04377dda-e619-0410-9926-eae83683ac58
Diffstat (limited to 'trunk/src')
-rwxr-xr-xtrunk/src/mkbuild53
1 files changed, 29 insertions, 24 deletions
diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild
index 172bc9c..8572e77 100755
--- a/trunk/src/mkbuild
+++ b/trunk/src/mkbuild
@@ -18,8 +18,8 @@
#
# Based in model generic.SlackBuild of Luiz
#
-# Version 1.0.4
-PROG_VERSION=1.0.4
+# Version 1.0.5
+PROG_VERSION=1.0.5
PROG_NAME=`basename $0`
#--------------------------------------------------------------------
@@ -139,16 +139,10 @@ function set_parameters {
# Use: set_parameters $@
# where $@ are the parameters input
#
- ALL_PAR=( $@ ) # all parameters
- N_PAR=$# # number of parameters
- i=0 # start counter
-
- # analyze all the parameters
- while [ $i -lt $N_PAR ]; do
- # get parameter[i]
- PAR=${ALL_PAR[$i]}
- case $PAR in
+ # Parameters analyze
+ while [ "$1" ]; do
+ case $1 in
'-c'|'--commit')
# Commit directory
COMMIT=$on
@@ -156,8 +150,9 @@ function set_parameters {
'-n'|'--new')
# New mkbuild configure file
let i++
- MKBUILD_NAME=${ALL_PAR[$i]}
+ MKBUILD_NAME=$2
[ ${MKBUILD_NAME:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR "--new <mkbuild_name>"
+ shift
;;
'-d'|'--debug')
# Debug mode
@@ -178,72 +173,82 @@ function set_parameters {
'-a'|'--author')
# Enter with author name
let i++
- AUTHOR=${ALL_PAR[$i]}
+ AUTHOR=$2
[ ${AUTHOR:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR AUTHOR
+ shift
;;
'-ai'|'--author_initials')
# Enter with author name
let i++
- AUTHOR_INITIALS=${ALL_PAR[$i]}
+ AUTHOR_INITIALS=$2
[ ${AUTHOR_INITIALS:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR AUTHOR_INITIALS
+ shift
;;
'-cs'|'--const_string')
# Enter with construction source name string
let i++
- CONST_STRING=${ALL_PAR[$i]}
+ CONST_STRING=$2
[ ${CONST_STRING:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR CONST_STRING
+ shift
;;
'-md'|'--model')
# Enter with SlackBuild model
let i++
- MODEL=${ALL_PAR[$i]}
+ MODEL=$2
[ ${MODEL:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR MODEL
+ shift
;;
'-j'|'--jobs')
# Enter with SlackBuild model
let i++
- NUMJOBS=${ALL_PAR[$i]}
+ NUMJOBS=$2
[ ${NUMJOBS:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR NUMJOBS
[ ! is_number $NUMJOBS ] && mkbuild_error $ERROR_INPUT_PAR NUMJOBS
NUMJOBS="-j$NUMJOBS"
+ shift
;;
'--prefix')
# Enter with SlackBuild model
let i++
- PREFIX=${ALL_PAR[$i]}
+ PREFIX=$2
[ ${PREFIX:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR PREFIX
+ shift
;;
'-pn'|'--pkg_name')
# Enter with package name
let i++
- PKG_NAME=${ALL_PAR[$i]}
+ PKG_NAME=$2
[ ${PKG_NAME:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR PKG_NAME
+ shift
;;
'-pv'|'pkg_version')
# Enter with package version
let i++
- VERSION=${ALL_PAR[$i]}
+ VERSION=$2
[ ${VERSION:0:1} = "-" ] && mkbuild_error $ERROR_INPUT_PAR VERSION
+ shift
;;
'-sn'|'--src_name')
# Enter with source name
let i++
- SRC_NAME=${ALL_PAR[$i]}
+ SRC_NAME=$2
[ ${SRC_NAME:0:1} = '-' ] && mkbuild_error $ERROR_INPUT_PAR SRC_NAME
+ shift
;;
'-u'|'--url')
# Enter with url address
let i++
- URL=${ALL_PAR[$i]}
+ URL=$2
[ ${URL:0:1} = '-' ] && mkbuild_error $ERROR_INPUT_PAR URL
+ shift
;;
*)
# mkbuild input file
- MK_INPUT_FILE="${PAR//.mkbuild}.mkbuild"
+ MK_INPUT_FILE="${1//.mkbuild}.mkbuild"
[ ! -e $MK_INPUT_FILE ] && mkbuild_error $ERROR_FILE_NOT_FOUND $MK_INPUT_FILE
;;
esac
- let i++
+ shift
done
}