X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tools%2Fnd_build;h=baf77a8d84cbac2765b172332af47609cacfb038;hb=298e442c2d3ecdcc29608d7e06d4576144b87992;hp=6bd6d88a2ffae9b59e54bda18caa994be5f49134;hpb=9192b13ef4779cabc0881c944487930213751282;p=neurodebian.git diff --git a/tools/nd_build b/tools/nd_build index 6bd6d88..baf77a8 100755 --- a/tools/nd_build +++ b/tools/nd_build @@ -31,7 +31,22 @@ EOT exit 1 fi -. /home/cowbuilder/bin/nd_cmdsettings.sh +family=$1 +dist=$2 + +set -e + +if [ -z "$family" ]; then + echo "You need to provide a distribution family ('debian', 'ubuntu'); prefix with 'nd+' to enable the NeuroDebian repository." + exit 1 +fi + +if [ -z "$dist" ]; then + echo "You need to provide a distribution codename (e.g. 'lenny', 'squeeze')." + exit 1 +fi + +. /etc/neurodebian/cmdsettings.sh # common options opts="--distribution $dist --aptcache $aptcache --buildplace $buildplace" @@ -62,11 +77,36 @@ 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" + if [ "$a" = "amd64" ]; then + # only force source into the upload for NeuroDebian + if [ ! "$family" = "${family#nd+*}" ]; then + options="$opts --debbuildopts -sa" + fi + 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 . \ - $opts \ - $* + --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