fix 升级时,新版本必须大于旧版本

This commit is contained in:
liuheng 2024-12-18 17:28:13 +08:00
parent 3e154d8b86
commit 2f6146577b

View File

@ -13,7 +13,7 @@
Name: opengauss
Version: 6.0.0
Release: 21
Release: 22
Summary: openGauss is an open source relational database management system
License: MulanPSL-2.0 and MIT and BSD and zlib and TCL and Apache-2.0 and BSL-1.0
URL: https://gitee.com/opengauss/openGauss-server
@ -309,8 +309,8 @@ if [ $1 -eq 1 ]; then
elif [ $1 -eq 2 ]; then
echo "Preparing for upgrade"
old_version=$(rpm -qi opengauss | grep -i version | awk -F':' '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//')
if [ "$(printf '%s\n' "%{version}" "$old_version" | sort -V | head -n1)" == "$old_version" ]; then
echo "Error: New version (${version}) must be greater than the old version ($old_version)."
if [ "$(printf '%s\n' "%{version}" "$old_version" | sort -V | head -n1)" == "%{version}" ]; then
echo "Error: New version (%{version}) must be greater than the old version ($old_version)."
exit 1
fi
if [[ "${old_version}" == "2.1.0" && %{version} == "6.0.0" ]]; then
@ -466,6 +466,9 @@ fi
%changelog
* Sat Dec 14 2024 liuheng <liuheng76@huawei.com> - 6.0.0-22
- Fix bugs: when upgrading, the new version cannot be lower than the old version
* Sat Dec 14 2024 liuheng <liuheng76@huawei.com> - 6.0.0-21
- Fix different versions of autoconf and resolve exceptions