summaryrefslogtreecommitdiffstats
path: root/redhat/build/get_latest_built_package_version.sh
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2021-08-26 10:29:27 +0200
committerFrançois Andriot <albator78@libertysurf.fr>2021-08-27 19:26:57 +0200
commit1140c7d6f5a1fba90b873f8fda0eac72f9e750a1 (patch)
treef79cb5a9558a2ca5b6fa7bc9c8356942a6c64ac3 /redhat/build/get_latest_built_package_version.sh
parent95b9a3f9646886ffaf6c19dbcaed43503f73dae1 (diff)
downloadtde-packaging-1140c7d6f5a1fba90b873f8fda0eac72f9e750a1.tar.gz
tde-packaging-1140c7d6f5a1fba90b873f8fda0eac72f9e750a1.zip
RPM: update for opensuse tumbleweed
Signed-off-by: François Andriot <albator78@libertysurf.fr>
Diffstat (limited to 'redhat/build/get_latest_built_package_version.sh')
-rwxr-xr-xredhat/build/get_latest_built_package_version.sh21
1 files changed, 17 insertions, 4 deletions
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