From: Lyndon Nerenberg Date: Thu, 7 Aug 2014 00:48:18 +0000 (-0700) Subject: Add new build tool: tools/showbuildenv X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/2f2e3e508d9128961087abbe206ddd951e6b9d62?ds=sidebyside;hp=-c Add new build tool: tools/showbuildenv This prints some basic information about the build environment. It's intended use is to print some information about the specific build environment for each of the builds in the buildbot cluster. In particular, the patch level of the OS, and the versions of 3rd-party packages installed on the system, compiler versions, etc. --- 2f2e3e508d9128961087abbe206ddd951e6b9d62 diff --git a/tools/showbuildenv b/tools/showbuildenv new file mode 100755 index 00000000..686d188b --- /dev/null +++ b/tools/showbuildenv @@ -0,0 +1,41 @@ +#!/bin/sh + +# Print a description of the build environment. This is here mainly +# for the use of the buildbot cluster, allowing developers to see the +# 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. + +offset () { + sed -e 's/^/ /' +} +header () { + echo + echo $* + echo +} + +os=`uname` + +for i in a m p r s v; do + eval uname_${i}=\'$(uname -${i} 2>/dev/null)\' +done + +header Shell Variables: +set | sort -d -t= | offset +echo + + +case ${os} in + + FreeBSD) + header Installed packages: + (pkg info 2>/dev/null | offset) || true + (pkg_info 2>/dev/null | offset) || true + ;; + +esac