From 0be4a91a0f40a7f3f860abc1bf4b437a9be3c7df Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Thu, 1 Dec 2011 10:29:58 +0000 Subject: [PATCH] Write more compact code. --- sit | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/sit b/sit index 440cada..66cbafa 100755 --- a/sit +++ b/sit @@ -55,12 +55,12 @@ else fi -case $PLATFORM in - hermit) - if [ "$COMPILER" == "system" ] ; then - echo "Using system default compiler" - COMPILER="" # prevent any compiler specs in the prefix - else +if [ "$COMPILER" == "system" ] ; then + echo "Using system default compiler" + COMPILER="" # prevent any compiler specs in the prefix +else + case $PLATFORM in + hermit) module swap $(module list -l 2>&1 | awk '/^PrgEnv-/{print $1}') PrgEnv-${COMPILER} if [ ! -z "$COMPILER_VERSION" ] ; then if [ "${COMPILER}" == "gnu" ] ; then @@ -69,13 +69,8 @@ case $PLATFORM in module swap $COMPILER $COMPILER/$COMPILER_VERSION fi fi - fi - ;; - laki|*) - if [ "$COMPILER" == "system" ] ; then - echo "Using system default compiler" - COMPILER="" # prevent any compiler specs in the prefix - else + ;; + laki|*) if [ -z "$COMPILER_VERSION" ] ; then COMPILER_MODULE=compiler/${COMPILER} else @@ -83,9 +78,9 @@ case $PLATFORM in fi echo "Loading compiler module ${COMPILER_MODULE}" module load ${COMPILER_MODULE} - fi - ;; -esac + ;; + esac +fi if [ ! -z "${COMPILER}" ] ; then # reevaluate compiler version