13 arch=$3 # limit to 1 for now
16 dscfilef=$(readlink -f $dscfile)
17 dscfilef_base=${dscfilef%%.dsc}
21 #? TODO -- should be a parameter as well?
23 testdir=${dscfilef_base}_$arch.testrdepends.$family-$dist
24 secdir=${dscfilef_base}_$arch.testrdepends.$family-$dist.secure
28 oldbuildsdir=$srcdir/old
29 newbuildsdir=$srcdir/new
31 echo "I: Building the new package for $pkg"
33 mkdir -p $debdir $srcdir $bindir $secdir
34 $CMD nd_build $family $dist $arch $dscfile --buildresult=$debdir
36 echo "I: Initiating the repository"
38 dpkg-scanpackages . >| Packages
39 apt-ftparchive release . >| Release
41 gpgargs="--no-default-keyring --secret-keyring $secdir/keyring.sec --keyring $secdir/keyring.pub"
42 if [ ! -e $secdir/keyring.sec ]; then
43 # Generate a key to sign the Release file
44 cat >| $secdir/keyring.gen <<EOF
45 %echo Generating a standard key
50 Name-Real: NeuroDebian Tester
51 Name-Comment: Temporary key
52 Name-Email: team@neuro.debian.net
54 Passphrase: salty salt
55 %pubring $secdir/keyring.pub
56 %secring $secdir/keyring.sec
57 # Do a commit here, so that we can later print "done" :-)
62 gpg --batch --gen-key $secdir/keyring.gen
63 gpg $gpgargs --list-secret-keys
66 echo "I: signing Release file"
67 gpg $gpgargs --list-secret-keys
68 gpg --yes -abs -u "NeuroDebian Tester" \
69 $gpgargs --passphrase "salty salt" \
70 -o Release.gpg Release
71 pubkey=$(gpg $gpgargs -a --export -u "NeuroDebian Tester")
73 # All binary packages produced
74 pkgs=$(awk '/^Package:/{print $2;}' Packages)
77 echo "I: Fetching all bdepends for $pkgs in $family $dist under $arch"
78 # need first to provide the necessary scripts out there
79 cp -p $(dirname $0)/nd_fetch_bdepends $bindir
80 $CMD nd_execute $family $dist $arch --bindmounts $testdir $bindir/nd_fetch_bdepends $dist $srcdir $pkgs
82 echo "I: preparing the hook"
83 cat << EOF >| $bindir/D00add_custom_repo
84 echo 'deb file://$debdir ./' >| /etc/apt/sources.list.d/custom.list
85 echo "$pubkey" | apt-key add -
86 apt-get update || /bin/bash < /dev/tty > /dev/tty 2> /dev/tty
88 chmod a+x $bindir/D00add_custom_repo
90 echo "I: Going throught the packages and testing the builds"
92 summary_file=${testdir}.summary
93 echo -e "\nTesting builds against $dscfile" >> $summary_file
95 echo " I: Building $dsc with native versions"
98 nd_build $family $dist $arch $dsc --buildresult=$oldbuildsdir \
99 && old=ok || old=FAILED
100 mv ${dscbase}_$arch.build $oldbuildsdir
101 echo " I: Building $dsc with new versions"
102 nd_build $family $dist $arch $dsc --buildresult=$newbuildsdir \
103 --hookdir=$bindir --bindmount=$testdir \
104 && new=ok || new="FAILED $newbuildsdir/${dscbase}_$arch.build"
105 mv ${dscbase}_$arch.build $newbuildsdir
106 printf '%-40s\t%5s\t%5s\n' $dsc "$old" "$new" >> $summary_file