Add some boilerplate
[buildd-scripts.git] / bin / build-client
index 029c613..28539b6 100755 (executable)
@@ -27,8 +27,9 @@ fi
 
 attempt_update () {
     rsync -a build@jack:build-config/ /etc/
+    install -m 755 -o root -g root /etc/schroot/local-chroot.d/* /etc/schroot/chroot.d/
     rsync -a --delete build@jack:chroots/ /chroot/rebuildd/chroots/
-    apt-get update
+    apt-get update > /dev/null 2>&1
     
     MY_MD5=$(md5sum $0 | awk '{print $1}')
     JACK_MD5=$(ssh build@jack md5sum $JACK_SCRIPT | awk '{print $1}')
@@ -72,15 +73,8 @@ grab_and_build () {
     fi
 
     echo 1 > /proc/sys/abi/swp || true
+    echo 1 > /proc/sys/abi/cp15_barrier || true
     
-#    PBUILD_TAR=${PBUILD_CACHE}/unstable-${ARCH}.tgz
-#    pbuilder build \
-#           --buildresult /chroot/rebuildd/out-$PKG \
-#           --bindmounts "/sys /proc /dev /dev/pts" \
-#           --basetgz ${PBUILD_TAR} \
-#           --timeout 4h \
-#           *.dsc
-
     sudo -u sbuild sbuild \
         --host=$ARCH --build=$ARCH -A -d sid \
         --apt-update --apt-distupgrade -n \
@@ -105,7 +99,8 @@ while true; do
     BNUM=$(echo $BNUM_PKG_VER_ARCH | cut -d " " -f1)
     PKG_VER_ARCH=$(echo $BNUM_PKG_VER_ARCH | cut -d " " -f2)
     if [ "$PKG_VER_ARCH" = "NOPACKAGE" ]; then
-       echo "Nothing to do, wait..."
+       DATE=$(date)
+       echo "$DATE: Nothing to do, wait..."
        sleep 10
        continue
     fi
@@ -118,6 +113,7 @@ while true; do
     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
     (grab_and_build $BNUM $PKG $VER $ARCH >${LOGDIR}/${PKG_VER_ARCH}.log 2>&1)
 
@@ -130,9 +126,6 @@ while true; do
        successful)
            rsync ${LOGDIR}/${PKG_VER_ARCH}.log build@jack:logs/${ARCH}/PASS/${PKG_VER_ARCH}.log
            ;;
-       given-back)
-           rsync ${LOGDIR}/${PKG_VER_ARCH}.log build@jack:logs/${ARCH}/FAIL_SOURCE/${PKG_VER_ARCH}.log
-           ;;
        *)
            rsync ${LOGDIR}/${PKG_VER_ARCH}.log build@jack:logs/${ARCH}/FAIL/${PKG_VER_ARCH}.log
            ;;
@@ -140,7 +133,7 @@ while true; do
     rm ${LOGDIR}/${PKG_VER_ARCH}.log
     rsync -a /chroot/rebuildd/out-$PKG/ build@jack:out/
     rm -rf /chroot/rebuildd/out-$PKG
-    ssh build@jack ./bin/report_build_result "$HOSTNAME says $BNUM $PKG_VER_ARCH was $RESULT"
+    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
        echo "Reached build limit of $MAX_BUILDS, stopping"