You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tde-packaging/redhat/build/get_latest_built_package_ve...

18 lines
488 B

#!/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}" ${TDE_VERSION})
[ ! -r "${RPM}" ] && echo "No package found for '${PKGNAME}' !" && exit 2
VERSION=$(rpm -qp --qf "%{version}-%{release}" "${RPM}")
VERSION=${VERSION%.opt} # Remove '.opt' suffix
VERSION=${VERSION%.[a-z]*} # Remove distro suffix (e.g. '.el6')
VERSION=${VERSION/-*_0_/\~}
echo $VERSION