From d0d639699b105b6c4f3cec98bba461d1c322a6d5 Mon Sep 17 00:00:00 2001 From: hangjin2020 <850894759@qq.com> Date: Fri, 11 Mar 2022 10:58:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=B0=8F=E5=9E=8B=E5=8C=96?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteom/upgrade_common.sh | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/liteom/upgrade_common.sh b/liteom/upgrade_common.sh index 81a4f35d6..ce003ffde 100644 --- a/liteom/upgrade_common.sh +++ b/liteom/upgrade_common.sh @@ -386,25 +386,21 @@ function check_pkg() { kernel="EULER" fi elif [[ -f "/etc/openEuler-release" ]]; then - kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}' | tr a-z A-Z) + kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}') elif [[ -f "/etc/centos-release" ]]; then - kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr a-z A-Z) + kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}') else - kernel=$(lsb_release -d | awk -F ' ' '{print $2}' | tr a-z A-Z) + kernel=$(lsb_release -d | awk -F ' ' '{print $2}') fi log "kernel: ${kernel}" #detect platform information. - platform=32 - bit=$(getconf LONG_BIT) - if [[ "$bit" -eq 64 ]]; then - platform=64 - fi - binname="GaussDB-Kernel-.*-${platform}bit" + platform_arch=$(uname -p) + bin_name="openGauss-Lite.*-${kernel}-${platform_arch}" binfile=$(ls -a | grep -E "${binname}.bin") shafile=${binfile%.*}.sha256 if [[ ! -f "${binfile}" ]] || [[ ! -f "${shafile}" ]]; then - die "bin or sha256 file not exit for the platform ${kernel}-${platform}bit!" ${err_upgrade_pre} + die "bin or sha256 file not exit for the platform ${kernel}-${platform_arch}!" ${err_upgrade_pre} fi sha_expect=$(cat ${shafile}) sha_current=$(sha256sum ${binfile} | awk '{print $1}') @@ -461,8 +457,8 @@ function decompress_pkg() { fi fi - if cp "$binfile" "$GAUSS_TMP_PATH"/install_bin_"$new_version" && cd "$GAUSS_TMP_PATH"/install_bin_"$new_version" && chmod u+x "$binfile" \ - && ./"$binfile" > /dev/null && rm -f "$binfile"; then + if cp "$binfile" "$GAUSS_TMP_PATH"/install_bin_"$new_version" && cd "$GAUSS_TMP_PATH"/install_bin_"$new_version" && tar -zxf "$binfile" \ + && rm -f "$binfile"; then log "Decompress $binfile successfully." else