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: Updating target chroot $family $dist"
32 $CMD nd_updatedist $family $dist $arch
34 mkdir -p $debdir $srcdir $bindir $secdir
36 echo "I: Building the new package for $pkg"
37 $CMD nd_build $family $dist $arch $dscfile --buildresult=$debdir
39 echo "I: Initiating the repository"
41 dpkg-scanpackages . >| Packages
42 apt-ftparchive release . >| Release
44 gpgargs="--no-default-keyring --secret-keyring $secdir/keyring.sec --keyring $secdir/keyring.pub"
45 if [ ! -e $secdir/keyring.sec ]; then
46 # Generate a key to sign the Release file
47 cat >| $secdir/keyring.gen <<EOF
48 %echo Generating a standard key
53 Name-Real: NeuroDebian Tester
54 Name-Comment: Temporary key
55 Name-Email: team@neuro.debian.net
57 Passphrase: salty salt
58 %pubring $secdir/keyring.pub
59 %secring $secdir/keyring.sec
60 # Do a commit here, so that we can later print "done" :-)
65 gpg --batch --gen-key $secdir/keyring.gen
66 gpg $gpgargs --list-secret-keys
69 echo "I: signing Release file"
70 gpg $gpgargs --list-secret-keys
71 gpg --yes -abs -u "NeuroDebian Tester" \
72 $gpgargs --passphrase "salty salt" \
73 -o Release.gpg Release
74 pubkey=$(gpg $gpgargs -a --export -u "NeuroDebian Tester")
76 # All binary packages produced
77 pkgs=$(awk '/^Package:/{print $2;}' Packages)
80 echo "I: Fetching all bdepends for $pkgs in $family $dist under $arch"
81 # need first to provide the necessary scripts out there
82 cp -p $(dirname $0)/nd_fetch_bdepends $bindir
83 $CMD nd_execute $family $dist $arch --bindmounts $testdir $bindir/nd_fetch_bdepends $dist $srcdir $pkgs
85 echo "I: preparing the hook"
86 cat << EOF >| $bindir/D00add_custom_repo
87 echo 'deb file://$debdir ./' >| /etc/apt/sources.list.d/custom.list
88 echo "$pubkey" | apt-key add -
89 apt-get update || /bin/bash < /dev/tty > /dev/tty 2> /dev/tty
91 chmod a+x $bindir/D00add_custom_repo
93 echo "I: Going throught the packages and testing the builds"
95 summary_file=${testdir}.summary
96 echo -e "\nTesting builds against $dscfile" >> $summary_file
98 echo " I: Building $dsc with native versions"
101 nd_build $family $dist $arch $dsc --buildresult=$oldbuildsdir \
102 && old=ok || old=FAILED
103 mv ${dscbase}_$arch.build $oldbuildsdir
104 echo " I: Building $dsc with new versions"
105 nd_build $family $dist $arch $dsc --buildresult=$newbuildsdir \
106 --hookdir=$bindir --bindmount=$testdir \
107 && new=ok || new="FAILED $newbuildsdir/${dscbase}_$arch.build"
108 mv ${dscbase}_$arch.build $newbuildsdir
109 printf '%-40s\t%5s\t%5s\n' $dsc "$old" "$new" >> $summary_file