summaryrefslogtreecommitdiffstats
path: root/redhat/build/get_latest_tarball_version.sh
blob: dd3448765d00202391e21a18cf81b63bc31ce837 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

PKGNAME="${1##*/}"
TDE_VERSION="${2:-${TDE_VERSION:-14.0.7}}"

[ -z "${PKGNAME}" ] && echo "You must specify a package name !" && exit 1

TARBALL=$(get_latest_tarball_filename.sh "${PKGNAME}" ${TDE_VERSION})

[ ! -r "${TARBALL}" ] && exit 2

VERSION=${TARBALL##*/}
VERSION=${VERSION#trinity-}
VERSION=${VERSION#${PKGNAME}-}
VERSION=${VERSION#*-}
VERSION=${VERSION%.tar.gz}
VERSION=${VERSION%.tar.bz2}
echo "$VERSION"