Skip to content

Commit

Permalink
Add BUILD_CONFIG[OS_FULL_VERSION]
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leonard <anleonar@redhat.com>
  • Loading branch information
andrew-m-leonard committed Jun 21, 2021
1 parent 631f4e3 commit 916ce49
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions sbin/common/config_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ OPENJDK_FOREST_NAME
OPENJDK_SOURCE_DIR
OPENJDK_UPDATE_VERSION
OS_KERNEL_NAME
OS_FULL_VERSION
OS_ARCHITECTURE
PATCHES
RELEASE
Expand Down Expand Up @@ -366,6 +367,35 @@ function configDefaults() {
# The OS kernel name, e.g. 'darwin' for Mac OS X
BUILD_CONFIG[OS_KERNEL_NAME]=$(uname | awk '{print tolower($0)}')

# Determine OS full system version
local unameSys=$(uname -s)
local unameOSSysVer=$(uname -sr)
if [ "${unameSys}" == "Linux" ]; then
# Linux distribs add more useful distrib /etc/*-release file content
set +e
cat /etc/*-release > /dev/null
local cmdRc="$?"
if [ "${cmdRc}" == "0" ]; then
local linuxName=""
cat /etc/*-release | grep PRETTY_NAME > /dev/null
cmdRc="$?"
if [ "${cmdRc}" == "0" ]; then
linuxName=$(cat /etc/*-release | grep PRETTY_NAME | cut -d'=' -f2 | tr -d '"')
else
linuxName=$(cat /etc/*-release | tr -d '"')
fi
unameOSSysVer="${unameOSSysVer} : ${linuxName}"
fi
set -e
elif [ "${unameSys}" == "AIX" ]; then
# AIX provides full version info using oslevel
aixVer=$(oslevel)
unameOSSysVer="${unameSys} ${aixVer}"
fi

# Store the OS full version name, eg.Darwin 20.4.0
BUILD_CONFIG[OS_FULL_VERSION]="${unameOSSysVer}"

local arch=$(uname -m)

if [ "${BUILD_CONFIG[OS_KERNEL_NAME]}" == "aix" ]; then
Expand Down

0 comments on commit 916ce49

Please sign in to comment.