1.1 --- a/nbbuild/newbuild/build-nbi.sh Tue Jul 09 11:14:42 2013 +0200
1.2 +++ b/nbbuild/newbuild/build-nbi.sh Tue Jul 30 14:56:02 2013 +0200
1.3 @@ -2,7 +2,7 @@
1.4
1.5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1.6 #
1.7 - # Copyright 2012 Oracle and/or its affiliates. All rights reserved.
1.8 + # Copyright 2012-2013 Oracle and/or its affiliates. All rights reserved.
1.9 #
1.10 # Oracle and Java are registered trademarks of Oracle and/or its affiliates.
1.11 # Other names may be trademarks of their respective owners.
1.12 @@ -101,6 +101,7 @@
1.13 BASE_COMMAND="$MAC_PATH/installer/mac/newbuild/build.sh $MAC_PATH $BASENAME_PREFIX $BUILDNUMBER $BUILD_NBJDK7 '"$SIGNING_IDENTITY"' $LOCALES"
1.14
1.15 ssh $NATIVE_MAC_MACHINE "$UNLOCK_COMMAND $BASE_COMMAND" > $MAC_LOG_NEW 2>&1 &
1.16 + REMOTE_MAC_PID=$!
1.17
1.18 fi
1.19
1.20 @@ -119,15 +120,17 @@
1.21 TAIL_PID=$!
1.22
1.23 set +x
1.24 - RUNNING_JOBS_COUNT=`jobs | wc -l | tr " " "\n" | grep -v '^$'`
1.25 + RUNNING_JOBS_COUNT=`ps --pid $REMOTE_MAC_PID | wc -l | tr " " "\n" | grep -v '^$'`
1.26 + echo "Entering loop with count of running jobs: " $RUNNING_JOBS_COUNT
1.27 #Wait for the end of native mac build
1.28 while [ $RUNNING_JOBS_COUNT -ge 2 ]; do
1.29 #1 or more jobs
1.30 sleep 10
1.31 - jobs > /dev/null
1.32 - RUNNING_JOBS_COUNT=`jobs | wc -l | tr " " "\n" | grep -v '^$'`
1.33 + RUNNING_JOBS_COUNT=`ps --pid $REMOTE_MAC_PID | wc -l | tr " " "\n" | grep -v '^$'`
1.34 + echo "----> count of running jobs: " $RUNNING_JOBS_COUNT
1.35 done
1.36 set -x
1.37 + echo "Will kill " $TAIL_PID
1.38 kill -s 9 $TAIL_PID
1.39 fi
1.40