Renamed controll variable $SIT_RUN_OPTION to more adequate $sit_action.
This commit is contained in:
parent
4dff164737
commit
ad39567ef5
1 changed files with 34 additions and 35 deletions
25
sit
25
sit
|
@ -10,18 +10,18 @@ set -e
|
|||
# for debugging:
|
||||
# set -x
|
||||
|
||||
# Reading in execution option
|
||||
SIT_RUN_OPTION=$2
|
||||
if [[ -n $SIT_RUN_OPTION ]] ; then
|
||||
echo "Executing with option: $SIT_RUN_OPTION"
|
||||
else
|
||||
echo "Default execution"
|
||||
fi
|
||||
|
||||
SIT_PATH=$(cd $(dirname $PWD/$0); pwd)
|
||||
SIT_CONFIG_FILE=$SIT_PATH/etc/sit.conf
|
||||
SIT_USER_CONFIG_FILE=$HOME/.sit
|
||||
|
||||
# sit action to be performed
|
||||
sit_action=$2
|
||||
if [[ -n $sit_action ]] ; then
|
||||
echo "Performing action: $sit_action"
|
||||
else
|
||||
sit_action="all"
|
||||
fi
|
||||
|
||||
# Reading in user configuration file if it exists
|
||||
if [[ -e $SIT_USER_CONFIG_FILE ]] ; then
|
||||
source $SIT_USER_CONFIG_FILE
|
||||
|
@ -195,7 +195,7 @@ sit_countdown 3
|
|||
|
||||
# if working dir already exists and execution option is Default then remove
|
||||
# previous working directory and create new
|
||||
if [[ -d ${WORKDIR} && -z $SIT_RUN_OPTION ]] ; then
|
||||
if [[ -d ${WORKDIR} && -z $sit_action ]] ; then
|
||||
sit_info "Removing existing working directory ${WORKDIR}"
|
||||
sit_countdown 5
|
||||
rm -rf ${WORKDIR}
|
||||
|
@ -214,7 +214,7 @@ else
|
|||
fi
|
||||
|
||||
|
||||
case $SIT_RUN_OPTION in
|
||||
case $sit_action in
|
||||
"sitinfo")
|
||||
sit_sitinfo >> "$LOGDIR/sit_cmd.log"
|
||||
;;
|
||||
|
@ -248,13 +248,12 @@ sit_copy_logs
|
|||
"setperms")
|
||||
sit_setperms
|
||||
;;
|
||||
"")
|
||||
"all")
|
||||
sit_sitinfo >> "$LOGDIR/sit_cmd.log"
|
||||
sit_unpack 2>&1 | tee "$LOGDIR/unpack.log"; ( exit ${PIPESTATUS[0]} )
|
||||
sit_prepare 2>&1 | tee "$LOGDIR/prepare.log"; ( exit ${PIPESTATUS[0]} )
|
||||
sit_configure 2>&1 | tee "$LOGDIR/configure.log"; ( exit ${PIPESTATUS[0]} )
|
||||
sit_build 2>&1 | tee "$LOGDIR/make.log"; ( exit ${PIPESTATUS[0]} )
|
||||
|
||||
sit_pretest 2>&1 | tee "$LOGDIR/pretest.log"; ( exit ${PIPESTATUS[0]} )
|
||||
sit_install 2>&1 | tee "$LOGDIR/make_install.log"; ( exit ${PIPESTATUS[0]} )
|
||||
sit_posttest 2>&1 | tee "$LOGDIR/posttest.log"; ( exit ${PIPESTATUS[0]} )
|
||||
|
@ -263,7 +262,7 @@ sit_copy_logs
|
|||
sit_setperms
|
||||
;;
|
||||
*)
|
||||
echo "Argument $SIT_RUN_OPTION unrecognized."
|
||||
echo "Unknown action $sit_action"
|
||||
esac
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue