Separate out build and out dirs by arch too
authorSteve McIntyre <steve@einval.com>
Thu, 15 Nov 2018 13:27:51 +0000 (13:27 +0000)
committerSteve McIntyre <steve@einval.com>
Thu, 15 Nov 2018 13:27:51 +0000 (13:27 +0000)
bin/build-client

index 39110fa..bd3fec4 100755 (executable)
@@ -138,17 +138,19 @@ while true; do
 
     DATE=$(date)
     echo "$DATE: starting build $BNUM: ${PKG} version ${VER} for ${ARCH}"
-    rm -rf build-$PKG out-$PKG
-    mkdir build-$PKG out-$PKG
-    chown -R sbuild: build-$PKG out-$PKG
-    cd build-$PKG
+    BUILDDIR="build-$PKG-$ARCH"
+    OUTDIR="out-$PKG-$ARCH"
+    rm -rf $BUILDDIR $OUTDIR
+    mkdir $BUILDDIR $OUTDIR
+    chown -R sbuild: $BUILDDIR $OUTDIR
+    cd $BUILDDIR
     (grab_and_build $BNUM $PKG $VER $ARCH >${LOGDIR}/${PKG_VER_ARCH}.log 2>&1)
 
     RESULT=$(tail -10 ${LOGDIR}/${PKG_VER_ARCH}.log | awk '/^Status:/ {print $2}')
     DATE=$(date)
     echo "   $DATE: returned $RESULT"
     cd ..
-    rm -rf build-$PKG
+    rm -rf $BUILDDIR
     case $RESULT in
        successful)
            rsync ${LOGDIR}/${PKG_VER_ARCH}.log build@jack:logs/${ARCH}/PASS/${PKG_VER_ARCH}.log
@@ -158,8 +160,8 @@ while true; do
            ;;
     esac
     rm ${LOGDIR}/${PKG_VER_ARCH}.log
-    rsync -a /chroot/rebuildd/out-$PKG/ build@jack:out/
-    rm -rf /chroot/rebuildd/out-$PKG
+    rsync -a /chroot/rebuildd/$OUTDIR/ build@jack:out/
+    rm -rf /chroot/rebuildd/$OUTDIR/
     ssh build@jack ./bin/report_build_result $HOSTNAME $BNUM $PKG_VER_ARCH $RESULT
     BUILDS_DONE=$(($BUILDS_DONE + 1))
     if [ $MAX_BUILDS -gt 0 ] && [ $BUILDS_DONE -ge $MAX_BUILDS ]; then