4 ARCH=$(dpkg-architecture -q DEB_BUILD_ARCH)
7 while getopts ":p:a:" opt; do
15 chk=`dpkg-architecture -a$ARCH > /dev/null 2>&1 ; echo $?`
17 if [ $chk != 0 ]; then
18 echo "Did not recognise ${ARCH} as a Debian architecture name. Exit."
24 echo "Invalid option: -$OPTARG" >&2
29 PATH=/usr/local/sbin:/usr/local/bin:$PATH
32 NUMCPUS=$(grep processor /proc/cpuinfo | wc -l)
33 if [ $NUMCPUS -gt 1 ]; then
34 PARALLEL="-j $NUMCPUS"
42 mysid=sid-93sam-strace-$RANDOM
44 BASE_CHROOT="sid_$ARCH-dchroot"
46 schroot -e -c $mysid || true
47 schroot -b -c $BASE_CHROOT -n $mysid
48 dd-schroot-cmd -y -c $mysid apt-get update
49 dd-schroot-cmd -y -c $mysid apt-get build-dep strace
50 dd-schroot-cmd -y -c $mysid apt-get install git autotools-dev gawk dh-autoreconf
52 DATETIME=$(date -u '+%Y-%m-%d-%H%M%S')
53 BDIR=~/build/strace/build-test-${DATETIME}
58 cat > ~/build/strace/inside-schroot-test.sh << EOF
61 git clone -q http://git.code.sf.net/p/strace/code strace.git
62 echo "BUILD ENVIRONMENT INFORMATION"
63 echo "============================="
64 echo "Debian architecture"
65 echo "-------------------"
66 dpkg-architecture -q DEB_BUILD_ARCH
73 echo "Version of kernel headers (linux-libc-dev)"
74 echo "------------------------------------------"
75 dpkg -s linux-libc-dev
76 echo "Version of libc"
77 echo "---------------"
87 make $PARALLEL && make check VERBOSE=1 && echo SUCCESS > ${BDIR}/RESULT
90 chmod +x ~/build/strace/inside-schroot-test.sh
94 # Run the command, outout to typescript
95 script -c "schroot -r -c $mysid ~/build/strace/inside-schroot-test.sh"
97 if [ ! -f ${BDIR}/RESULT ] ; then
98 echo "BUILD FAILED - not doing cleanup"
99 echo "Results in ${BDIR}"
103 rm -f ~/build/strace/inside-schroot-test.sh
104 mv typescript typescript-$ARCH-$HOSTNAME-${DATETIME}.txt
106 gzip -9 typescript-$ARCH-$HOSTNAME-${DATETIME}.txt
107 FILE="typescript-$ARCH-$HOSTNAME-${DATETIME}.txt.gz"
109 (echo "START $FILE" ; \
111 echo "END $FILE") | \
112 mailx -s "strace-build-test $ARCH-$HOSTNAME-${DATETIME} log" \
113 steve-strace@einval.com