]> diplodocus.org Git - nmh/blob - tools/showbuildenv
Run lsb_release(1) if uname is Linux.
[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 case ${os} in
32
33 Darwin)
34 header Compilers:
35 cc -v 2>&1 | offset
36 echo
37 lex --version | offset
38 echo
39 yacc --version | offset
40 ;;
41
42 FreeBSD)
43 header Compilers:
44 cc -v 2>&1 | offset
45
46 header Installed packages:
47 (pkg info 2>/dev/null | offset) || true
48 (pkg_info 2>/dev/null | offset) || true
49 ;;
50
51 Linux)
52 header Linux distribution:
53 (lsb_release -a 2>&1 | offset) || true
54 esac