From: Andrew Schoen Date: Tue, 27 Oct 2015 17:35:04 +0000 (-0500) Subject: trap the output of chacra exists in a var and then check that var X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F162%2Fhead;p=ceph-build.git trap the output of chacra exists in a var and then check that var Signed-off-by: Andrew Schoen --- diff --git a/ceph-build-next/build/build_deb b/ceph-build-next/build/build_deb index 172fe5c7..652ff579 100644 --- a/ceph-build-next/build/build_deb +++ b/ceph-build-next/build/build_deb @@ -11,10 +11,10 @@ vers=`cat ./dist/version` distro=`python -c "exec 'import platform; print platform.linux_distribution()[0].lower()'"` chacra_endpoint="ceph/${chacra_ref}/${distro}/{$dist}/${ARCH}" -chacractl exists binaries/${chacra_endpoint} +chacractl exists binaries/${chacra_endpoint}; exists=$? || true # if the binary already exists in chacra, do not rebuild -if [ $? -e 0 ] && [ "$FORCE" = false ] ; then +if [ $exists -e 0 ] && [ "$FORCE" = false ] ; then echo "The endpoint at ${chacra_endpoint} already exists and FORCE was not set, Exiting..." exit 0 fi diff --git a/ceph-build-next/build/build_rpm b/ceph-build-next/build/build_rpm index 15940fe1..e6c55a68 100644 --- a/ceph-build-next/build/build_rpm +++ b/ceph-build-next/build/build_rpm @@ -58,10 +58,10 @@ vers=`cat ./dist/version` [ "$TEST" = true ] && chacra_ref="$vers" || chacra_ref="test" chacra_baseurl="ceph/${chacra_ref}/${DISTRO}/${RELEASE}" -chacractl exists binaries/${chacra_baseurl}/${ARCH} +chacractl exists binaries/${chacra_baseurl}/${ARCH}; exists=$? || true # if the binary already exists in chacra, do not rebuild -if [ $? -e 0 ] && [ "$FORCE" = false ]; then +if [ $exists -e 0 ] && [ "$FORCE" = false ]; then echo "The endpoint at ${chacra_baseurl}/${ARCH} already exists and FORCE was not set, Exiting..." exit 0 fi