]> diplodocus.org Git - nmh/blobdiff - tools/showbuildenv
README.manpages: Add `Common errors and subjective conventions'.
[nmh] / tools / showbuildenv
index 089eea75541eb84f98b613d1ff2adf9b3cc9dd00..81f278e86bd257b0a951c56738aa9616ac3fb926 100755 (executable)
@@ -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 () {
@@ -34,7 +35,7 @@ for f in \
     ; do
     test -f $f || continue
     header $f
-    cat $f
+    offset $f
     break
 done
 
@@ -63,11 +64,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
        ;;
-
-    Linux)
-        header Linux distribution:
-        (lsb_release -a 2>&1 | offset) || true
 esac