X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fyaml.sh;h=202fed36894657841e50245070930a474ba01fba;hb=c9f9e9c54f5284093b689dd0d7fa8baf5a5b2c97;hp=a8830852e60b73ff3fa71d4eca3d1ed702bd6494;hpb=b1edba5b8743bb1ba5cd8e554e88f9b2ec34f1e0;p=fs%2Flustre-release.git diff --git a/lustre/tests/yaml.sh b/lustre/tests/yaml.sh index a883085..202fed3 100644 --- a/lustre/tests/yaml.sh +++ b/lustre/tests/yaml.sh @@ -73,25 +73,36 @@ yml_code_review() { } release() { - if [ -r /etc/lsb-release ]; then - dist=$(grep 'DISTRIB_ID' /etc/lsb-release | sed 's/DISTRIB_ID=//' | head -1) - elif [ -r /etc/redhat-release ]; then - dist=$(awk '/release/ { printf("%s %s %s", $1, $2, $3)}' /etc/redhat-release) - elif [ -r /etc/*-release ]; then - dist=$(find /etc/ -maxdepth 1 -name '*release' 2> /dev/null | \ - sed -e 's/\/etc\///' -e 's/-release//' | head -1) - else - dist="UNKNOWN" - fi + if [ -r /etc/SuSE-release ]; then + name=$(awk '/SUSE/ { printf("%s %s %s %s", $1, $2, $3, $4) }' \ + /etc/SuSE-release) + version=$(sed -n -e 's/^VERSION = //p' /etc/SuSE-release) + level=$(sed -n -e 's/^PATCHLEVEL = //p' /etc/SuSE-release) + dist="${name} ${version}.${level}" + elif [ -r /etc/os-release ]; then + name=$(sed -n -e 's/"//g' -e 's/^NAME=//p' /etc/os-release) + version=$(sed -n -e 's/"//g' -e 's/^VERSION_ID=//p' \ + /etc/os-release) + dist="${name} ${version}" + elif [ -r /etc/system-release ]; then + dist=$(awk '/release/ \ + { printf("%s %s %s", $1, $2, $3) }' \ + /etc/system-release) + elif [ -r /etc/*-release ]; then + dist=$(find /etc/ -maxdepth 1 -name '*release' 2> /dev/null | \ + sed -e 's/\/etc\///' -e 's/-release//' | head -n1) + else + dist="UNKNOWN" + fi - echo $dist + echo $dist } yml_build_info() { - local TEST_DISTRO=$(release) - local LUSTRE_VERSION=$(lctl lustre_build_version | awk '/Lustre version:/ {print $3}') - local LUSTRE_BUILD=${LUSTRE_BUILD_SOURCE:-$(sed 's/-.*//' <<<$LUSTRE_VERSION)} - local FILE_SYSTEM=$(node_fstypes $(hostname -s)) + local TEST_DISTRO=$(release) + local LUSTRE_VERSION=$(lustre_build_version) + local LUSTRE_BUILD=${LUSTRE_BUILD_SOURCE:-$LUSTRE_VERSION} + local FILE_SYSTEM=$(node_fstypes $(hostname -s)) cat <