]> diplodocus.org Git - nmh/blob - tools/showbuildenv
A-ha! automake has support for tests expected to fail; use that.
[nmh] / tools / showbuildenv
1 #!/bin/sh
2
3 # Print a description of the build environment. This is here mainly
4 # for the use of the buildbot cluster, allowing developers to see the
5 # build environment on machines they can't login on. It also provides
6 # a history in the build logs that might be useful in catching
7 # regressions.
8 #
9 # This script should *only* report basic information about the build
10 # environment, and only that necessary to reproduce the build
11 # environment.
12 #
13 # FIXME: Document meaning of script's exit status, if any.
14 # It jumps through hoops with `|| true' despite not using `set -e'.
15
16 offset () {
17 sed -e '/./s/^/ /'
18 }
19
20 header () {
21 echo
22 echo $*
23 echo
24 }
25
26 os=`uname`
27
28 for i in a m p r s v; do
29 eval uname_${i}=\'$(uname -${i} 2>/dev/null)\'
30 done
31
32 header Shell Variables:
33 set | sort -d -t= | offset
34
35 case ${os} in
36
37 Darwin)
38 header Compilers:
39 cc -v 2>&1 | offset
40 echo
41 lex --version | offset
42 echo
43 yacc --version | offset
44 ;;
45
46 FreeBSD)
47 header Compilers:
48 cc -v 2>&1 | offset
49
50 header Installed packages:
51 (pkg info 2>/dev/null | offset) || true
52 (pkg_info 2>/dev/null | offset) || true
53 ;;
54
55 Linux)
56 header Linux distribution:
57 (lsb_release -a 2>&1 | offset) || true
58 esac