X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/86df74051ed8804aab61a128d3135377d158867a..792d7e1eb3ef80e73646fb060bfe9ab776752310:/tools/showbuildenv diff --git a/tools/showbuildenv b/tools/showbuildenv index 415c169d..2338bc6c 100755 --- a/tools/showbuildenv +++ b/tools/showbuildenv @@ -5,20 +5,36 @@ # 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/^/ /' + sed -e '/./s/^/ /' "$@" } + header () { echo - echo $* + echo "$@" echo } +# os-release is the new s*stemd standard. Then it's the more unique +# ones with redhat-release bringing up the rear because other platforms +# 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/fedora-release /etc/gentoo-release /etc/redhat-release \ + /etc/lsb-release \ + ; do + test -f $f || continue + header $f + offset $f + break +done + os=`uname` for i in a m p r s v; do @@ -28,7 +44,6 @@ done header Shell Variables: set | sort -d -t= | offset - case ${os} in Darwin) @@ -45,8 +60,8 @@ case ${os} in cc -v 2>&1 | offset 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 ;; - esac