From efd50532e4092e594fc5f6c14ab65da338b0c68b Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 2 Jun 2015 10:04:51 -0400 Subject: [PATCH] use to loop over DEB or RPM cases Signed-off-by: Alfredo Deza --- ceph-deploy/build/build | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ceph-deploy/build/build b/ceph-deploy/build/build index d95fb573..c65d95f0 100644 --- a/ceph-deploy/build/build +++ b/ceph-deploy/build/build @@ -31,8 +31,16 @@ echo " BRANCH=$BRANCH" rpm_dists="rhel centos6.5 centos7 rhel6.5 rhel7 centos sles11sp2 opensuse12.2" deb_dists="precise wheezy squeeze trusty" -case $HOST in -gitbuilder-*-rpm*) +# A helper to match an item in a list of items, like python's `if item in list` +listcontains() { + for word in $2; do + [[ $word = $1 ]] && return 0 + done + return 1 +} + +if listcontains $DIST "$rpm_dists" +then rm -rf rpm-repo dist/* build/rpmbuild # Tag tree and update version number in change log and @@ -94,8 +102,9 @@ gitbuilder-*-rpm*) cd $WORKSPACE mkdir -p dist exit 0 - ;; -gitbuilder-cdep-deb* | tala* | mira*) + +elif listcontains $DIST "$deb_dists" +then rm -rf debian-repo rm -rf dist rm -f ../*.changes ../*.dsc ../*.gz ../*.diff @@ -175,9 +184,8 @@ EOF mkdir -p dist mv ../*.changes ../*.dsc ../*.deb ../*.tar.gz dist/. echo "Done" - ;; -*) + +else echo "Can't determine build host type" exit 4 - ;; -esac +fi -- 2.47.3