]> diplodocus.org Git - nmh/blob - tools/showbuildenv
Okay, a bit closer.
[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 offset () {
14 sed -e 's/^/ /'
15 }
16 header () {
17 echo
18 echo $*
19 echo
20 }
21
22 os=`uname`
23
24 for i in a m p r s v; do
25 eval uname_${i}=\'$(uname -${i} 2>/dev/null)\'
26 done
27
28 header Shell Variables:
29 set | sort -d -t= | offset
30
31
32 case ${os} in
33
34 Darwin)
35 header Compilers:
36 cc -v 2>&1 | offset
37 echo
38 lex --version | offset
39 echo
40 yacc --version | offset
41 ;;
42
43 FreeBSD)
44 header Compilers:
45 cc -v 2>&1 | offset
46
47 header Installed packages:
48 (pkg info 2>/dev/null | offset) || true
49 (pkg_info 2>/dev/null | offset) || true
50 ;;
51
52 esac