X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/3fcb4665e17d451b0a1865353843c3dbdd1b5ca7..ef1ba39e8dae81091b6c3e73e72825ef6edea3c6:/tools/showbuildenv?ds=inline diff --git a/tools/showbuildenv b/tools/showbuildenv index 93f5efef..5eec6ee8 100755 --- a/tools/showbuildenv +++ b/tools/showbuildenv @@ -14,7 +14,7 @@ # It jumps through hoops with `|| true' despite not using `set -e'. offset () { - sed -e '/./s/^/ /' + sed -e '/./s/^/ /' "$@" } header () { @@ -23,6 +23,21 @@ header () { 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 @@ -51,8 +66,4 @@ case ${os} in (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