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

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

BUILT=$(get_latest_built_package_version.sh ${PKGNAME} ${TDE_VERSION})
TARBALL=$(get_latest_tarball_version.sh ${PKGNAME} ${TDE_VERSION})

if [ "${BUILT/\~/}" != "${BUILT}" ]; then
  if [ "${BUILT#*\~}" = "${TARBALL#*\~}" ]; then
    echo "Latest package '${PKGNAME}' version '${BUILT}' is already built."
    exit 0
  fi
else
  if [ "${TARBALL%-*}" = "${BUILT%-*}" ]; then
    echo "Latest package '${PKGNAME}' version '${BUILT}' is already built."
    exit 0
  fi
fi

exit 1