diff options
author | François Andriot <albator78@libertysurf.fr> | 2014-12-15 23:38:06 +0100 |
---|---|---|
committer | François Andriot <albator78@libertysurf.fr> | 2014-12-15 23:38:06 +0100 |
commit | d19d14a03103d32059598d292defb77945309f28 (patch) | |
tree | ee992c9fa6b2aaf1f12cefcccaec75e2eaa0a550 /redhat/build/get_latest_tarball_filename.sh | |
parent | 092caa810a152ddcbc89e908fee1f4611a5acc70 (diff) | |
download | tde-packaging-d19d14a03103d32059598d292defb77945309f28.tar.gz tde-packaging-d19d14a03103d32059598d292defb77945309f28.zip |
RPM packaging: update for R14
Diffstat (limited to 'redhat/build/get_latest_tarball_filename.sh')
-rwxr-xr-x | redhat/build/get_latest_tarball_filename.sh | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/redhat/build/get_latest_tarball_filename.sh b/redhat/build/get_latest_tarball_filename.sh index 3cdeb904d..0e1d6ebdc 100755 --- a/redhat/build/get_latest_tarball_filename.sh +++ b/redhat/build/get_latest_tarball_filename.sh @@ -6,22 +6,37 @@ TDE_VERSION="${2:-14.0.0}" [ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1 [ -d "${TARBALLS_DIR}" ] || TARBALLS_DIR=~/tde/tde-tarballs/${TDE_VERSION}/ [ -d "${TDE_PACKAGING_DIR}" ] || TDE_PACKAGING_DIR=~/tde/tde-packaging -[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${PACKAGING_DIR}/redhat/ +[ -d "${DIST_PACKAGING_DIR}" ] || DIST_PACKAGING_DIR=${TDE_PACKAGING_DIR}/redhat/ + +EXTRA_DIR="$(cd ${TARBALLS_DIR}/../extras/; pwd)" + +RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 + +RET=$(find "${TARBALLS_DIR}" "${EXTRA_DIR}" -name "${PKGNAME}-${TDE_VERSION}*.tar.gz" | sort -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 RET=$(find "${TARBALLS_DIR}" -name "trinity-${PKGNAME}-[0-9]*.tar.gz" | sort -n | tail -n 1) -if [ -z "${RET}" ]; then - RET=$(find "${TARBALLS_DIR}/../extras/" -name "${PKGNAME}[-_][0-9]*.tar.*" | sort -n | tail -n 1) -fi -if [ ! -r "${RET}" ]; then - # Retry without 'trinity-*', and allow any TAR extension. - RET=$(find "${DIST_PACKAGING_DIR}" -name "${PKGNAME}-[0-9]*.tar*" | sort -n | tail -n 1) - if [ ! -r "${RET}" ]; then - # 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 -n | tail -n 1) - fi -fi - -[ -z "${RET}" ] && exit 2 - -echo "${RET}" +[ -r "${RET}" ] && echo "${RET}" && exit 0 + +RET=$(find "${EXTRA_DIR}" -name "${PKGNAME}[-_][0-9]*.tar.*" | sort -n | 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 -n | 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 -n | 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 -n | 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 -n | tail -n 1) +[ -r "${RET}" ] && echo "${RET}" && exit 0 + + exit 0 |