]> git.donarmstrong.com Git - neurodebian.git/blobdiff - tools/nd_build
Also for stats report which repo and which job number use our setup
[neurodebian.git] / tools / nd_build
index 72c7d0092fc09deb477a11a558c1fbc88fd8ddaf..baf77a8d84cbac2765b172332af47609cacfb038 100755 (executable)
@@ -77,6 +77,8 @@ else
   shift; shift; shift; shift
 fi
 
+# failed will be set to 1 if any build fails
+failed=
 for a in $arch; do
   # default
   options="$opts"
@@ -88,11 +90,23 @@ for a in $arch; do
   else
     options="$opts --debbuildopts -B"
   fi
+
   echo "Building for $family $dist $a ..."
+  buildfile="${dscfile%.dsc}_${a}.build"
+  tsfile="${buildfile}.timestamp.`date +%s`" # "unique" timestamp file
+  /usr/bin/time -f "%E real, %U user, %S sys, %O out" -o "${tsfile}" \
   cowbuilder --build $dscfile \
              --basepath ${cowbuilderroot}/cow/${family}-${dist}-${a}.cow \
              --buildresult . \
-             --logfile ${dscfile%.dsc}_${a}.build \
+             --logfile "${buildfile}" \
              $options \
-             "$@"
+             "$@" && status='OK' || { status='FAILED'; failed=1; }
+  timeinfo=$(tail -n 1 "${tsfile}")
+  # Update the summary of builds
+  touch summary.build                               # Assure existence
+  sed -i -e "s/\(${buildfile}.*out$\)/\1 OLD/g" summary.build  # Mark previous entry as OLD
+  echo -e "${buildfile}\t$status\t$timeinfo" >> summary.build  # Add current one
+  rm -f "${tsfile}"
 done
+# Exit with failure status if any built failed
+[ -z $failed ] || exit 1