X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/ecc4ea809452d95ab51ff8669d66fe0549260377..912755a7e0ad3d94d084798dd60bb7397abf3931:/tools/showbuildenv diff --git a/tools/showbuildenv b/tools/showbuildenv index 089eea75..9db0f3e2 100755 --- a/tools/showbuildenv +++ b/tools/showbuildenv @@ -5,16 +5,17 @@ # build environment on machines they can't login on. It also provides # a history in the build logs that might be useful in catching # regressions. -# +# # This script should *only* report basic information about the build # environment, and only that necessary to reproduce the build # environment. # -# FIXME: Document meaning of script's exit status, if any. -# It jumps through hoops with `|| true' despite not using `set -e'. +# The script's exit status must be zero if all went acceptably well as +# buildbot checks for this and marks the `environment' stage as failed +# otherwise. offset () { - sed -e '/./s/^/ /' + sed -e '/./s/^/ /' "$@" } header () { @@ -28,13 +29,13 @@ header () { # also use that to placate broken logic that use its prescence as a # use-RPM test. for f in \ - /etc/os-release /etc/arch-release /etc/debian_version \ + /etc/os-release /etc/arch-release /etc/centos-release /etc/debian_version \ /etc/fedora-release /etc/gentoo-release /etc/redhat-release \ /etc/lsb-release \ ; do test -f $f || continue header $f - cat $f + offset $f break done @@ -62,12 +63,9 @@ case ${os} in header Compilers: cc -v 2>&1 | offset - header Installed packages: + header Installed packages: + #### pkg(7) or pkg_info(1) might not always be available. (pkg info 2>/dev/null | offset) || true (pkg_info 2>/dev/null | offset) || true ;; - - Linux) - header Linux distribution: - (lsb_release -a 2>&1 | offset) || true esac