summaryrefslogtreecommitdiffstats
path: root/redhat/build/get_latest_tarball_filename.sh
diff options
context:
space:
mode:
Diffstat (limited to 'redhat/build/get_latest_tarball_filename.sh')
-rwxr-xr-xredhat/build/get_latest_tarball_filename.sh38
1 files changed, 9 insertions, 29 deletions
diff --git a/redhat/build/get_latest_tarball_filename.sh b/redhat/build/get_latest_tarball_filename.sh
index d7e1ce37d..895516a2a 100755
--- a/redhat/build/get_latest_tarball_filename.sh
+++ b/redhat/build/get_latest_tarball_filename.sh
@@ -1,7 +1,7 @@
#!/bin/bash
PKGNAME="${1##*/}"
-TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
+TDE_VERSION="${2:-${TDE_VERSION:-14.0.6}}"
[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1
[ -d "${TARBALLS_DIR}" ] || TARBALLS_DIR=~/tde/tarballs/${TDE_VERSION}/
@@ -10,33 +10,13 @@ TDE_VERSION="${2:-${TDE_VERSION:-14.0.5}}"
EXTRA_DIR="$(cd ${TARBALLS_DIR}/../extras/; pwd)"
-RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -V | tail -n 1)
-[ -r "${RET}" ] && echo "${RET}" && exit 0
-
-RET=$(find "${TARBALLS_DIR}" "${EXTRA_DIR}" -follow -name "${PKGNAME}-${TDE_VERSION}*.tar.gz" -o -name "trinity-${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -V | tail -n 1)
-[ -r "${RET}" ] && echo "${RET}" && exit 0
-
-RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-[0-9]*.tar.gz" | sort -V | tail -n 1)
-[ -r "${RET}" ] && echo "${RET}" && exit 0
-
-RET=$(find "${EXTRA_DIR}" -follow -name "${PKGNAME}[-_][0-9]*.tar.*" | sort -V | tail -n 1)
-[ -r "${RET}" ] && echo "${RET}" && exit 0
-
-# Now look in the 'tde-packaging' directory
-RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -V | tail -n 1)
-[ -r "${RET}" ] && echo "${RET}" && exit 0
-
-# Retry without 'trinity-*', and allow any TAR extension.
-RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -V | tail -n 1)
-[ -r "${RET}" ] && echo "${RET}" && exit 0
-
-# Retry without 'trinity-*', and allow any TAR extension.
-RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -V | tail -n 1)
-[ -r "${RET}" ] && echo "${RET}" && exit 0
-
-# Retry by removing numbers in package name, e.g "imlib1" => "imlib"
-RET=$(find "${DIST_PACKAGING_DIR}" -name "$(tr -d "[0-9]" <<< ${PKGNAME})-[0-9]*.tar*" | sort -V | tail -n 1)
-[ -r "${RET}" ] && echo "${RET}" && exit 0
-
+RET=""
+for dir in "${TARBALLS_DIR}" "${EXTRA_DIR}" "${DIST_PACKAGING_DIR}"; do
+ for v in "${PKGNAME}-${TDE_VERSION}*.tar.*" "trinity-${PKGNAME}-${TDE_VERSION}*.tar.*" "${PKGNAME}[-_][0-9]*.tar.*"; do
+ RET=$(find "${dir}" -follow -type f -name ${v} | sort -V | tail -n 1)
+ [ -r "${RET}" ] && break
+ done
+ [ -r "${RET}" ] && echo "${RET}" && break
+done
exit 0