]> diplodocus.org Git - nmh/blob - tools/showbuildenv
Remove unused NCWD and NPWD #defines.
[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-release is the new s*stemd standard. Then it's the more unique
27 # ones with redhat-release bringing up the rear because other platforms
28 # also use that to placate broken logic that use its prescence as a
29 # use-RPM test.
30 for f in \
31 /etc/os-release /etc/arch-release /etc/debian_version \
32 /etc/fedora-release /etc/gentoo-release /etc/redhat-release \
33 /etc/lsb-release \
34 ; do
35 test -f $f || continue
36 header $f
37 offset $f
38 break
39 done
40
41 os=`uname`
42
43 for i in a m p r s v; do
44 eval uname_${i}=\'$(uname -${i} 2>/dev/null)\'
45 done
46
47 header Shell Variables:
48 set | sort -d -t= | offset
49
50 case ${os} in
51
52 Darwin)
53 header Compilers:
54 cc -v 2>&1 | offset
55 echo
56 lex --version | offset
57 echo
58 yacc --version | offset
59 ;;
60
61 FreeBSD)
62 header Compilers:
63 cc -v 2>&1 | offset
64
65 header Installed packages:
66 (pkg info 2>/dev/null | offset) || true
67 (pkg_info 2>/dev/null | offset) || true
68 ;;
69 esac