improve build queue logging by reporting errors in builds; correctly remove source symlink after each successful and failed build.

This commit is contained in:
chess.griffin 2009-01-08 03:38:06 +00:00
parent 20c8f1dc82
commit fc71898416

View File

@ -1128,19 +1128,27 @@ fi
echo "Building Slackware package for $PKG..." echo "Building Slackware package for $PKG..."
export $BUILDOPTIONS export $BUILDOPTIONS
sh $PKG.SlackBuild.build || rm -rf $TMP/sbopkg_build.lck sh $PKG.SlackBuild.build || rm -rf $TMP/sbopkg_build.lck
echo "Done building package for $PKG."
cd $OUTPUT cd $OUTPUT
NEWPACKAGE=$(ls -1 *.tgz) if [ ! -e *.tgz ]; then
cd - echo "$PKG:" >> $SUMMARYLOG
echo "Built package: $NEWPACKAGE" >> $SUMMARYLOG echo "Error occurred with build. Please check the log." \
echo "Built package: $NEWPACKAGE" >> $SUMMARYLOG
if [ "$INSTALLPKGS" = "1" ]; then echo >> $SUMMARYLOG
else
echo "Done building package for $PKG."
NEWPACKAGE=$(ls -1 *.tgz)
echo "$PKG:" >> $SUMMARYLOG
echo "Built package: $NEWPACKAGE" >> $SUMMARYLOG
echo "Built package: $NEWPACKAGE"
if [ "$INSTALLPKGS" = "1" ]; then
install_package $SRCNAME install_package $SRCNAME
echo "Done installing/upgrading package for $PKG." echo "Done installing/upgrading package for $PKG."
echo "Installed package: $NEWPACKAGE" >> $SUMMARYLOG echo "Installed package: $NEWPACKAGE" >> $SUMMARYLOG
fi
mv $OUTPUT/* $OLDOUTPUT/
echo >> $SUMMARYLOG
fi fi
mv $OUTPUT/* $OLDOUTPUT/ cd -
echo >> $SUMMARYLOG
rm $SRCNAME rm $SRCNAME
rm -rf $PKG.info.build rm -rf $PKG.info.build
rm -rf $PKG.SlackBuild.build rm -rf $PKG.SlackBuild.build
@ -1381,11 +1389,12 @@ process_queue () {
# Iterate throught the process queue to build, and optionally # Iterate throught the process queue to build, and optionally
# install, the selected packages. # install, the selected packages.
SBOPKGOUTPUT=$TMP/sbopkg_output SBOPKGOUTPUT=$TMP/sbopkg_output
SBOPKGTMPOUTPUT=$TMP/sbopkg_tmpoutput
STARTQUEUE=$TMP/sbopkg-start-queue STARTQUEUE=$TMP/sbopkg-start-queue
FINALQUEUE=$TMP/sbopkg-final-queue FINALQUEUE=$TMP/sbopkg-final-queue
PRECHECKLOG=$TMP/sbopkg_precheck_log PRECHECKLOG=$TMP/sbopkg_precheck_log
SUMMARYLOG=$TMP/sbopkg_summary SUMMARYLOG=$TMP/sbopkg_summary
rm -rf $FINALQUEUE $PRECHECKLOG $SUMMARYLOG rm -rf $SBOPKGTMPOUTPUT $FINALQUEUE $PRECHECKLOG $SUMMARYLOG
check_root check_root
if [ $ROOT = "false" ]; then if [ $ROOT = "false" ]; then
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
@ -1495,7 +1504,8 @@ touch $TMP/sbopkg_build.lck
while [ -f $TMP/sbopkg_build.lck ]; do while [ -f $TMP/sbopkg_build.lck ]; do
for PKGBUILD in $(cat $FINALQUEUE); do for PKGBUILD in $(cat $FINALQUEUE); do
search_package $PKGBUILD search_package $PKGBUILD
build_package $PKGBUILD 2>&1 | tee $SBOPKGOUTPUT build_package $PKGBUILD 2>&1 | tee $SBOPKGTMPOUTPUT
cat $SBOPKGTMPOUTPUT >> $SBOPKGOUTPUT
done done
rm -rf $TMP/sbopkg_build.lck rm -rf $TMP/sbopkg_build.lck
done done