From 65bac707360ecdf4a080c90643244b523189d12d Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Fri, 10 Nov 2023 12:43:28 -0800 Subject: [PATCH] Make etc/ci/describe-system-config.sh POSIX-compliant For alpine --- etc/ci/describe-system-config.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/etc/ci/describe-system-config.sh b/etc/ci/describe-system-config.sh index dbcba70e782..99548015d88 100755 --- a/etc/ci/describe-system-config.sh +++ b/etc/ci/describe-system-config.sh @@ -1,20 +1,26 @@ -#!/usr/bin/env bash +#!/bin/sh -cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" +cd -- "$( dirname -- "$0" )" cd ../.. -function run() { - "${SHELL}" -c "$@" || true -} +if [ ! -z "${SHELL}" ]; then + run() { + "${SHELL}" -c "$@" || true + } +else + run() { + /bin/sh -c "$@" || true + } +fi if [ ! -z "$CI" ]; then - function group() { + group() { echo "::group::$@" run "$@" echo "::endgroup::" } else - function group() { run "$@"; } + group() { run "$@"; } fi group lscpu @@ -22,6 +28,11 @@ group uname -a group lsb_release -a group ulimit -aH group ulimit -aS +group "cat /etc/os-release" +group "cat /proc/cpuinfo" +group "cat /proc/meminfo" +group "apk info" +group "dpkg -l" group ghc --version group gcc --version group ocamlc -config @@ -30,3 +41,4 @@ group coqc --version group "true | coqtop" group etc/machine.sh group "echo PATH=$PATH" +group "echo SHELL=$SHELL"