version.sh: renamed some functions, small improvements

This commit is contained in:
levasseur
2021-10-06 17:53:37 +02:00
parent 25aa22fb95
commit a1372a5d50

View File

@@ -10,7 +10,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Return on stdout $distro $version $codename # Return on stdout $distro $version $codename
read_os_release() get_os_version()
{ {
if [[ ! -f /etc/os-release ]]; then if [[ ! -f /etc/os-release ]]; then
prnt E "Your distribution doesn't have the needed os-release file." prnt E "Your distribution doesn't have the needed os-release file."
@@ -47,17 +47,18 @@ export read_os_release
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Create system related variables # Create system related variables
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
get_os_version() set_sys_vars()
{ {
if [[ $# -ne 3 ]]; then if [[ $# -ne 4 ]]; then
prnt E "get_os_version(): incorect number of parameters ($@)." prnt E "get_os_version(): incorect number of parameters ($@)."
die 7 --force die --force 7
fi fi
export SYS_DIST=$1 export SYS_ARCH=$1
export SYS_VER=$2 export SYS_DIST=$2
if [[ $3 != "null" ]]; then export SYS_VER=$3
export SYS_CODE=$3 if [[ $4 != "null" ]]; then
export SYS_CODE=$4
fi fi
} }
export -f get_os_version export -f get_os_version