summaryrefslogtreecommitdiffstats
path: root/redhat/build/get_latest_built_package_filename.sh
diff options
context:
space:
mode:
Diffstat (limited to 'redhat/build/get_latest_built_package_filename.sh')
-rwxr-xr-xredhat/build/get_latest_built_package_filename.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/redhat/build/get_latest_built_package_filename.sh b/redhat/build/get_latest_built_package_filename.sh
index 2d9f9ee39..46c664578 100755
--- a/redhat/build/get_latest_built_package_filename.sh
+++ b/redhat/build/get_latest_built_package_filename.sh
@@ -2,13 +2,26 @@
PKGNAME="$1"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
+TDE_VERSION="${2:-14.0.0}"
-RPMDIR=$(rpm -E %_rpmdir)
+RPMDIR="$(rpm -E %{_rpmdir}.tde-${TDE_VERSION})"
+if [ $(uname -i) == "x86_64" ]; then
+ RPMDIR_ARCH=${RPMDIR}/x86_64
+else
+ RPMDIR_ARCH=${RPMDIR}/i?86
+fi
+RPMDIR_NOARCH=${RPMDIR}/noarch
+RPMDIRS="${RPMDIR_ARCH} ${RPMDIR_NOARCH}"
+
+case "${PKGNAME##*/}" in
+ "koffice") PKGNAME="koffice-suite";;
+ "tde-i18n") PKGNAME="tde-i18n-French";;
+esac
-RPM=$(find ${RPMDIR} -name "trinity-${PKGNAME}-[0-9]*.rpm" | sort -n | tail -n 1)
+RPM=$(find ${RPMDIRS} -name "trinity-${PKGNAME##*/}-[0-9]*.rpm" | sort -n | tail -n 1)
if [ ! -r "${RPM}" ]; then
- RPM=$(find ${RPMDIR} -name "${PKGNAME}-[0-9]*.rpm" | sort -n | tail -n 1)
+ RPM=$(find ${RPMDIRS} -name "${PKGNAME##*/}-[0-9]*.rpm" | sort -n | tail -n 1)
if [ ! -r "${RPM}" ]; then
echo "Error, cannot find any package for '${PKGNAME}' !"
exit 1