]> diplodocus.org Git - nmh/blobdiff - tools/showbuildenv
uip/burst.c: Increase coverage.
[nmh] / tools / showbuildenv
index 686d188bca4a85aa00d08c1579b149fcd6e6fe1d..5eec6ee8c93089cae3b5f2f48c190ca64c848941 100755 (executable)
@@ -9,16 +9,35 @@
 # This script should *only* report basic information about the build
 # environment, and only that necessary to reproduce the build
 # environment.
 # 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'.
 
 offset () {
 
 offset () {
-    sed -e 's/^/    /'
+    sed -e '/./s/^/    /' "$@"
 }
 }
+
 header () {
     echo
 header () {
     echo
-    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
 os=`uname`
 
 for i in a m p r s v; do
@@ -27,15 +46,24 @@ done
 
 header Shell Variables:
 set | sort -d -t= | offset
 
 header Shell Variables:
 set | sort -d -t= | offset
-echo
-
 
 case ${os} in
 
 
 case ${os} in
 
+  Darwin)
+       header Compilers:
+       cc -v 2>&1 | offset
+       echo
+       lex --version | offset
+       echo
+       yacc --version | offset
+       ;;
+
   FreeBSD)
   FreeBSD)
+       header Compilers:
+       cc -v 2>&1 | offset
+
        header Installed packages:
        (pkg info 2>/dev/null | offset) || true
        (pkg_info 2>/dev/null | offset) || true
        ;;
        header Installed packages:
        (pkg info 2>/dev/null | offset) || true
        (pkg_info 2>/dev/null | offset) || true
        ;;
-
 esac
 esac