From c15b5275237dd1ca3a0c193518bd4a3c69357616 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Wed, 7 Nov 2018 22:17:19 -0500 Subject: [PATCH] modified depending on comments --- build.sh | 2 +- ipmitool/build.sh | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index 5b709ec..56f29f2 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash pkgname=$1 -cur_path=$(cd "$(dirname "$0")"; pwd) +cur_path=$(dirname "$0") if [ "$pkgname" = "ipmitool" ]; then $cur_path/ipmitool/build.sh exit $? diff --git a/ipmitool/build.sh b/ipmitool/build.sh index eb36e51..61658d8 100755 --- a/ipmitool/build.sh +++ b/ipmitool/build.sh @@ -8,16 +8,14 @@ function check_linux_distro() echo "${distro}" } -build_dir=/ipmitool_build -if [ ${DEST} ]; then - build_dir=${DEST} -fi +pkgname="ipmitool" + +build_dir=${DEST:-/${pkgname}_build} XCAT_BUILD_DISTRO="$(check_linux_distro)" -echo "[INFO] Start to build ipmitool on $XCAT_BUILD_DISTRO" +echo "[INFO] Start to build $pkgname on $XCAT_BUILD_DISTRO" -cur_path=$(cd "$(dirname "$0")"; pwd) -cd $cur_path +cd "$(dirname "$0")" XCAT_BUILD_DISTRO="$(check_linux_distro)" case "${XCAT_BUILD_DISTRO}" in @@ -39,13 +37,13 @@ esac $buildcmd |& tee /tmp/build.log if [ $? != 0 ]; then - echo "[ERROR] Failed to build ipmitool by command $buildcmd" + echo "[ERROR] Failed to build $pkgname by command $buildcmd" exit 1 fi -buildpath=`find $dftpath -name ipmitool*.$pkgtype | xargs ls -t | head -n 1` +buildpath=`find $dftpath -name ${pkgname}*.$pkgtype | xargs ls -t | head -n 1` if [ -z "$buildpath" ]; then - echo "[ERROR] Could not find build ipmitool*.$pkgtype" + echo "[ERROR] Could not find build ${pkgname}*.$pkgtype" exit 1 fi