S14postupgrade: add lowercase os_version compatiblity

This commit is contained in:
Calin Crisan 2019-04-12 20:13:41 +03:00
parent d0e9221cf9
commit 40d40b6890
2 changed files with 8 additions and 1 deletions

View File

@ -23,7 +23,10 @@ function version_gt() {
}
function run_post_upgrade() {
version="$(source ${VERSION_FILE} 2>/dev/null && echo ${OS_VERSION})"
unset OS_VERSION
# ensure compatibility with previous lowercase os_version
version="$(source ${VERSION_FILE} 2>/dev/null && echo ${OS_VERSION}${os_version})"
sys_version="$(source ${SYS_VERSION_FILE} 2>/dev/null && echo ${OS_VERSION})"
versions=$(ls -1 ${POST_UPGRADE_DIR} | cut -d '.' -f 1)

View File

@ -5,6 +5,10 @@
function to_uppercase() {
IFS='='
while read line; do
if [[ -z "${line}" ]]; then
echo
continue
fi
parts=(${line})
echo $(tr 'a-z' 'A-Z' <<< ${parts[0]})=${parts[1]}
done