From b0d187aaf22eb01804a27ddf6688a1fca1f9f96a Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Fri, 5 Jun 2015 16:48:04 -0600 Subject: [PATCH] radosgw-agent: remove dependency on host naming scheme Don't use the hostname to determine the type of OS or build (Deb/RPM) to do. Instead, determine the OS type using the same code that we're using in ceph-build. --- radosgw-agent/build/build | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/radosgw-agent/build/build b/radosgw-agent/build/build index 42b68b63..26c85d39 100644 --- a/radosgw-agent/build/build +++ b/radosgw-agent/build/build @@ -24,8 +24,15 @@ echo " WS=$WORKSPACE" echo " PWD=$(pwd)" ls -l -case $HOST in -*rpm*) +is_suse() { + if hash zypper 2>/dev/null; then + echo 1 + else + echo 0 + fi +} + +if [[ ! -f /etc/redhat-release && is_suse -eq 1 ]] ; then rm -rf ./dist # Remove any previous artifacts mkdir -p $WORKSPACE/dist/noarch mkdir -p $WORKSPACE/dist/SRPMS @@ -55,8 +62,7 @@ case $HOST in cp -avf $HOME/rpmbuild/* $WORKSPACE/dist/ fi fi - ;; -*deb* | tala*) +else DEB_VERSION=$(dpkg-parsechangelog | sed -rne 's,^Version: (.*),\1, p') BP_VERSION=${DEB_VERSION}${BPTAG} DEBEMAIL="sandon@inktank.com" dch -D $DIST --force-distribution -b -v "$BP_VERSION" "$comment" @@ -69,9 +75,4 @@ case $HOST in mv ../*.changes ../*.dsc ../*.deb ../*.tar.gz dist/. fi - ;; -*) - echo "Can't determine build host type" - exit 4 - ;; -esac +fi -- 2.39.5