chacra_endpoint="radosgw-agent/${chacra_ref}/${DISTRO}/${DISTRO_VERSION}"
- $VENV/chacractl exists binaries/${chacra_endpoint}/noarch ; exists=$?
-
- # if the binary already exists in chacra, do not rebuild
- if [ $exists -eq 0 ] && [ "$FORCE" = false ] ; then
- echo "The endpoint at ${chacra_endpoint}/noarch already exists and FORCE was not set, Exiting..."
- exit 0
- fi
+ check_binary_existence $chacra_endpoint/noarch
suse=$(uname -n | grep -ic -e suse -e sles || true)
if [ $suse -gt 0 ]
chacra_endpoint="radosgw-agent/${chacra_ref}/${DISTRO}/${DEB_BUILD}/noarch"
- $VENV/chacractl exists binaries/${chacra_endpoint} ; exists=$?
-
- # if the binary already exists in chacra, do not rebuild
- if [ $exists -eq 0 ] && [ "$FORCE" = false ] ; then
- echo "The endpoint at ${chacra_endpoint} already exists and FORCE was not set, Exiting..."
- exit 0
- fi
+ check_binary_existence $chacra_endpoint
dpkg-source -b .
# we no longer sign the .dsc or .changes files (done by default with
esac
}
+
+check_binary_existence () {
+ url=$1
+
+ # we have to use ! here so thet -e will ignore the error code for the command
+ # because of this, the exit code is also reversed
+ ! $VENV/chacractl exists binaries/${url} ; exists=$?
+
+ # if the binary already exists in chacra, do not rebuild
+ if [ $exists -eq 1 ] && [ "$FORCE" = false ] ; then
+ echo "The endpoint at ${chacra_endpoint} already exists and FORCE was not set, Exiting..."
+ exit 0
+ fi
+
+}