From 1140c7d6f5a1fba90b873f8fda0eac72f9e750a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Thu, 26 Aug 2021 10:29:27 +0200 Subject: RPM: update for opensuse tumbleweed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot --- redhat/build/get_latest_built_package_version.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'redhat/build') diff --git a/redhat/build/get_latest_built_package_version.sh b/redhat/build/get_latest_built_package_version.sh index c0dd53c02..06a150913 100755 --- a/redhat/build/get_latest_built_package_version.sh +++ b/redhat/build/get_latest_built_package_version.sh @@ -13,11 +13,24 @@ pkg_version="$(rpm -qp --qf "%{version}" "${RPM}")" pkg_release="$(rpm -qp --qf "%{release}" "${RPM}")" # Application packages: version does not match TDE version -if [[ "${pkg_release}" =~ _0_ ]] || [[ "${pkg_release}" =~ ${TDE_VERSION}_ ]] ; then - eval VERSION="${pkg_release/_0_/\~}" +if [[ "${pkg_release}" =~ ^0_ ]]; then + # Preversion + if [[ "${pkg_release}" =~ ${TDE_VERSION}_ ]] ; then + # Likely application package + eval VERSION="${pkg_release/0_/\~}" + else + # Likely core package + eval VERSION="${pkg_version}${pkg_release/0_/\~}" + fi else - # Base package (tdelibs ...) - eval VERSION="${pkg_version}_${pkg_release/0_/\~}" + # Stable version + if [[ "${pkg_release}" =~ ${TDE_VERSION}_ ]] ; then + # Likely application package + eval VERSION="${pkg_release/_*/}" + else + # Likely core package + eval VERSION="${pkg_version}" + fi fi VERSION="${VERSION%.opt}" # Remove '.opt' suffix -- cgit v1.2.1