diff --git a/package/debian/build-deb.sh b/package/debian/build-deb.sh index d56f878769d..9a6d8c94f28 100755 --- a/package/debian/build-deb.sh +++ b/package/debian/build-deb.sh @@ -37,12 +37,12 @@ distname=$(grep '^ID=' /etc/os-release | awk -F'=' '{print $2}') distversion=$(grep 'VERSION_ID=' /etc/os-release | awk -F\" '{print $2}') arch=$(dpkg --print-architecture) -pkgname=${package}_${polar_pg_version}-${build_date}-${distname}${distversion}_${arch} +pkgname=${package}_${polar_version}-${polar_commit}-${distname}${distversion}_${arch} rm -rf ./${pkgname} mkdir -p ${pkgname}/DEBIAN cat ./control >> ${pkgname}/DEBIAN/control -echo 'Version: '${polar_pg_version}'-'${build_date}'' >> ${pkgname}/DEBIAN/control +echo 'Version: '${polar_version}'-'${polar_commit}'' >> ${pkgname}/DEBIAN/control echo 'Architecture: '${arch}'' >> ${pkgname}/DEBIAN/control prefix=/u01/polardb_pg diff --git a/package/rpm/PolarDB.spec b/package/rpm/PolarDB.spec index 4bf5b45ad33..5fcf9a47f4e 100644 --- a/package/rpm/PolarDB.spec +++ b/package/rpm/PolarDB.spec @@ -25,7 +25,7 @@ %define code_branch %(git rev-parse --abbrev-ref HEAD || echo unknown) %define polar_commit %(git rev-parse --short=8 HEAD || echo unknown) %define pg_version %(grep AC_INIT ../../configure.in | awk -F'[][]' '{print $4}') -%define polar_majorversion 2.0.%(echo %pg_version | awk -F'[^0-9]+' '{print $1}') +%define polar_majorversion 2.0.%{pg_version} %define polar_minorversion %(grep -A 1 '&polar_version' ../../src/backend/utils/misc/guc.c | awk 'NR==2{print}' | awk -F'[."]' '{print $4}').0 %define polar_release_date %(grep -A 1 '&polar_release_date' ../../src/backend/utils/misc/guc.c | awk 'NR==2{print}' | awk -F'[,"]' '{print $2}') %define polar_version %{polar_majorversion}.%{polar_minorversion} @@ -33,8 +33,8 @@ %define _build_id_links none %define __spec_install_pre /bin/true -Version: %{polar_pg_version} -Release: %{build_date}%{?dist} +Version: %{polar_version} +Release: %{polar_commit}%{?dist} Summary: PolarDB Name: PolarDB Group: alibaba/application