summaryrefslogtreecommitdiffstats
path: root/redhat/build/get_latest_built_package_version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'redhat/build/get_latest_built_package_version.sh')
-rwxr-xr-xredhat/build/get_latest_built_package_version.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/redhat/build/get_latest_built_package_version.sh b/redhat/build/get_latest_built_package_version.sh
new file mode 100755
index 000000000..fa649c30f
--- /dev/null
+++ b/redhat/build/get_latest_built_package_version.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+PKGNAME="$1"
+TDE_VERSION="${2:-14.0.0}"
+
+[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
+
+RPM=$(get_latest_built_package_filename.sh "${PKGNAME}")
+
+[ ! -r "${RPM}" ] && echo "No package found for '${PKGNAME}' !" && exit 2
+
+VERSION=$(rpm -qp --qf "%{version}-%{release}" "${RPM}")
+VERSION=${VERSION%.opt}
+VERSION=${VERSION%.*}
+VERSION=${VERSION/-*_/\~}
+
+
+echo $VERSION