]> diplodocus.org Git - nmh/blob - tools/showbuildenv
Rename recently added ToUpper() to to_upper().
[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
17 header () {
18 echo
19 echo "$@"
20 echo
21 }
22
23 # os-release is the new s*stemd standard. Then it's the more unique
24 # ones with redhat-release bringing up the rear because other platforms
25 # also use that to placate broken logic that use its prescence as a
26 # use-RPM test.
27 for f in \
28 /etc/os-release /etc/arch-release /etc/debian_version \
29 /etc/fedora-release /etc/gentoo-release /etc/redhat-release \
30 /etc/lsb-release \
31 ; do
32 test -f $f || continue
33 header $f
34 offset $f
35 break
36 done
37
38 os=`uname`
39
40 for i in a m p r s v; do
41 eval uname_${i}=\'$(uname -${i} 2>/dev/null)\'
42 done
43
44 header Shell Variables:
45 set | sort -d -t= | offset
46
47 case ${os} in
48
49 Darwin)
50 header Compilers:
51 cc -v 2>&1 | offset
52 echo
53 lex --version | offset
54 echo
55 yacc --version | offset
56 ;;
57
58 FreeBSD)
59 header Compilers:
60 cc -v 2>&1 | offset
61
62 header Installed packages:
63 #### pkg(7) or pkg_info(1) might not always be available.
64 (pkg info 2>/dev/null | offset) || true
65 (pkg_info 2>/dev/null | offset) || true
66 ;;
67 esac
68
69 # Temporary test. Does anything care if the exit status is non-zero?
70 exit 42