From: Yaroslav Halchenko Date: Tue, 20 Sep 2011 02:47:06 +0000 (-0400) Subject: ENH: giving adequate name nd_build_testrdepends X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fbb9c4d817bf66c52dc246d9cd51d48c1ee30e80;p=neurodebian.git ENH: giving adequate name nd_build_testrdepends --- diff --git a/tools/nd_build_testrdepends b/tools/nd_build_testrdepends new file mode 100755 index 0000000..bc13696 --- /dev/null +++ b/tools/nd_build_testrdepends @@ -0,0 +1,67 @@ +#!/bin/bash + +# no undefined +set -u +# no failures +set -e + +CMD=echo + +family=$1 +dist=$2 +arch=$3 # limit to 1 for now + +dscfile=$4 +dscfilef=$(readlink -f $dscfile) +dscfilebase=${dscfilef%%.dsc} + +pkg=${dscfile%_*} + +#? TODO -- should be a parameter as well? + +testdir=$PWD/$pkg-$arch.test-bdepends +bindir=$testdir/bin +debdir=$testdir/debs +srcdir=$testdir/srcs +oldbuildsdir=$srcdir/old +newbuildsdir=$srcdir/new + +echo "I: Building the new package for $pkg" + +mkdir -p $debdir $srcdir $bindir +$CMD nd_build $family $dist $arch $dscfile --buildresult=$debdir + +cd $debdir +dpkg-scanpackages . >| Packages +cd - > /dev/null + +echo "I: Fetching all bdepends for $pkg in $family $dist under $arch" +# need first to provide the necessary scripts out there +cp -p $(dirname $0)/nd_fetch_bdepends $bindir +$CMD nd_execute $family $dist $arch --bindmounts $testdir $bindir/nd_fetch_bdepends $pkg $srcdir + +echo "I: preparing the hook" +cat << EOF >| $bindir/D00add_custom_repo +echo 'deb file://$debdir ./' >| /etc/apt/sources.list.d/custom.list +apt-get update +EOF +chmod a+x $bindir/D00add_custom_repo + +echo "I: Going throught the packages and testing the builds" +cd $srcdir +summary_file=${dscfilebase}_$arch.$family-$dist.test-rdeps +echo -e "\nTesting builds against $dscfile" >> $summary_file +for dsc in *dipy*.dsc; do + echo " I: Building $dsc with native versions" + src=${dsc%%_*} + dscbase=${dsc%%.dsc} + nd_build $family $dist $arch $dsc --buildresult=$oldbuildsdir \ + && old=ok || old=FAILED + mv ${dscbase}_$arch.build $oldbuildsdir + echo " I: Building $dsc with new versions" + nd_build $family $dist $arch $dsc --buildresult=$newbuildsdir \ + --hookdir=$bindir --bindmount=$testdir \ + && new=ok || new="FAILED $newbuildsdir/${dscbase}_$arch.build" + mv ${dscbase}_$arch.build $newbuildsdir + printf '%-20s\t%5s\t%5s\n' $dsc "$old" "$new" >> $summary_file +done diff --git a/tools/nd_test_bdepends b/tools/nd_test_bdepends deleted file mode 100755 index bc13696..0000000 --- a/tools/nd_test_bdepends +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -# no undefined -set -u -# no failures -set -e - -CMD=echo - -family=$1 -dist=$2 -arch=$3 # limit to 1 for now - -dscfile=$4 -dscfilef=$(readlink -f $dscfile) -dscfilebase=${dscfilef%%.dsc} - -pkg=${dscfile%_*} - -#? TODO -- should be a parameter as well? - -testdir=$PWD/$pkg-$arch.test-bdepends -bindir=$testdir/bin -debdir=$testdir/debs -srcdir=$testdir/srcs -oldbuildsdir=$srcdir/old -newbuildsdir=$srcdir/new - -echo "I: Building the new package for $pkg" - -mkdir -p $debdir $srcdir $bindir -$CMD nd_build $family $dist $arch $dscfile --buildresult=$debdir - -cd $debdir -dpkg-scanpackages . >| Packages -cd - > /dev/null - -echo "I: Fetching all bdepends for $pkg in $family $dist under $arch" -# need first to provide the necessary scripts out there -cp -p $(dirname $0)/nd_fetch_bdepends $bindir -$CMD nd_execute $family $dist $arch --bindmounts $testdir $bindir/nd_fetch_bdepends $pkg $srcdir - -echo "I: preparing the hook" -cat << EOF >| $bindir/D00add_custom_repo -echo 'deb file://$debdir ./' >| /etc/apt/sources.list.d/custom.list -apt-get update -EOF -chmod a+x $bindir/D00add_custom_repo - -echo "I: Going throught the packages and testing the builds" -cd $srcdir -summary_file=${dscfilebase}_$arch.$family-$dist.test-rdeps -echo -e "\nTesting builds against $dscfile" >> $summary_file -for dsc in *dipy*.dsc; do - echo " I: Building $dsc with native versions" - src=${dsc%%_*} - dscbase=${dsc%%.dsc} - nd_build $family $dist $arch $dsc --buildresult=$oldbuildsdir \ - && old=ok || old=FAILED - mv ${dscbase}_$arch.build $oldbuildsdir - echo " I: Building $dsc with new versions" - nd_build $family $dist $arch $dsc --buildresult=$newbuildsdir \ - --hookdir=$bindir --bindmount=$testdir \ - && new=ok || new="FAILED $newbuildsdir/${dscbase}_$arch.build" - mv ${dscbase}_$arch.build $newbuildsdir - printf '%-20s\t%5s\t%5s\n' $dsc "$old" "$new" >> $summary_file -done