diff --git a/packages/numlib/metis/5.1.0 b/packages/numlib/metis/5.1.0 index bff0f49..81ed7c2 100755 --- a/packages/numlib/metis/5.1.0 +++ b/packages/numlib/metis/5.1.0 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash -l # sit class file # # Christoph Niethammer (C) 2012 diff --git a/sit b/sit index 136b0fd..39533ce 100755 --- a/sit +++ b/sit @@ -1,4 +1,4 @@ -#!/bin/sh -l +#!/bin/bash -l # # Install script inspired by the ebuild system of Gentoo Linux # @@ -10,6 +10,14 @@ 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=$(dirname $PWD/$0) SIT_CONFIG_FILE=$SIT_PATH/etc/sit.conf SIT_USER_CONFIG_FILE=$HOME/.sit @@ -24,6 +32,8 @@ if [[ -e $SIT_CONFIG_FILE ]] ; then fi source "$SIT_PATH/functions.sh" +sit_countdown 1 + # identify platform manually if no environment variable was set PLATFORM=${PLATFORM:=$SITE_PLATFORM_NAME} if [ -z $PLATFORM ]; then @@ -179,13 +189,19 @@ echo "Logfile dir: $LOGDIR" sit_countdown 3 -if [ -d ${WORKDIR} ] ; then +# 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 sit_info "Removing existing working directory ${WORKDIR}" sit_countdown 5 rm -rf ${WORKDIR} fi -mkdir -p ${WORKDIR} -mkdir -p ${BUILDDIR} + +if [ ! -d ${WORKDIR} ] ; then + mkdir -p ${WORKDIR} + mkdir -p ${BUILDDIR} +fi + if [ ! -z ${LOGDIR} ] ; then mkdir -p ${LOGDIR} else @@ -193,6 +209,42 @@ else LOGDIR="/tmp" fi + +case $SIT_RUN_OPTION in +"sitinfo") +sit_sitinfo >> "$LOGDIR/sit_cmd.log" +;; +"unpack") +sit_unpack 2>&1 | tee "$LOGDIR/unpack.log"; ( exit ${PIPESTATUS[0]} ) +;; +"prepare") +sit_prepare 2>&1 | tee "$LOGDIR/prepare.log"; ( exit ${PIPESTATUS[0]} ) +;; +"configure") +sit_configure 2>&1 | tee "$LOGDIR/configure.log"; ( exit ${PIPESTATUS[0]} ) +;; +"build") +sit_build 2>&1 | tee "$LOGDIR/make.log"; ( exit ${PIPESTATUS[0]} ) +;; +"pretest") +sit_pretest 2>&1 | tee "$LOGDIR/pretest.log"; ( exit ${PIPESTATUS[0]} ) +;; +"install") +sit_install 2>&1 | tee "$LOGDIR/make_install.log"; ( exit ${PIPESTATUS[0]} ) +;; +"posttest") +sit_posttest 2>&1 | tee "$LOGDIR/posttest.log"; ( exit ${PIPESTATUS[0]} ) +;; +"postinst") +sit_postinst 2>&1 | tee "$LOGDIR/postinst.log"; ( exit ${PIPESTATUS[0]} ) +;; +"copy_logs") +sit_copy_logs +;; +"setperms") +sit_setperms +;; +"") 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]} ) @@ -204,7 +256,25 @@ sit_install 2>&1 | tee "$LOGDIR/make_install.log"; ( exit ${PIPESTATUS[0]} ) sit_posttest 2>&1 | tee "$LOGDIR/posttest.log"; ( exit ${PIPESTATUS[0]} ) sit_postinst 2>&1 | tee "$LOGDIR/postinst.log"; ( exit ${PIPESTATUS[0]} ) sit_copy_logs -sit_setperms +sit_setperms +;; +*) +echo "Argument $SIT_RUN_OPTION unrecognized." +esac + + +#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]} ) +#sit_postinst 2>&1 | tee "$LOGDIR/postinst.log"; ( exit ${PIPESTATUS[0]} ) +#sit_copy_logs +#sit_setperms cat <