From: Luis R. Rodriguez Date: Mon, 30 Apr 2012 20:45:27 +0000 (-0700) Subject: compat-wireless: propagate errors with ckmake X-Git-Tag: compat-2012-07-02~1^2~20 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=bfddeba400a92c7e7b9918a41333f299b3068aed;p=~tnikolova%2Fcompat%2F.git compat-wireless: propagate errors with ckmake If compilation failed with any kernel then propagate that error. Signed-off-by: Luis R. Rodriguez --- diff --git a/bin/ckmake b/bin/ckmake index d89d067..71142c9 100755 --- a/bin/ckmake +++ b/bin/ckmake @@ -26,6 +26,7 @@ KERNEL_DIR="/lib/modules" KLIBS="" LOG="ckmake.log" TIME="0" +RET="" LSB_RED_ID=$(/usr/bin/lsb_release -i -s) case $LSB_RED_ID in @@ -94,10 +95,17 @@ function run_ckmake() log_try_kernel $KERNEL ionice -c 3 nice -n 20 make -s KLIB=$DIR KLIB_BUILD=$DIR -j6 -Wunused-but-set-variable &>> $LOG - if [[ $? -eq 0 ]]; then + CUR_RET=$? + + if [[ $RET = "" ]]; then + RET=$CUR_RET + fi + + if [[ $CUR_RET -eq 0 ]]; then echo -e "${GREEN}[OK]${NORMAL}" | tee_color_split else echo -e "${RED}[FAILED]${NORMAL}" | tee_color_split + RET=$CUR_RET fi nice make clean KLIB=$DIR KLIB_BUILD=$DIR 2>&1 >> $LOG @@ -108,8 +116,10 @@ nice make clean 2>&1 > $LOG if [[ $TIME != "1" ]]; then run_ckmake - exit 0 + exit $RET fi time $0 time $0 | egrep "real|user|sys" + +exit $RET