]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
use to loop over DEB or RPM cases 60/head
authorAlfredo Deza <adeza@redhat.com>
Tue, 2 Jun 2015 14:04:51 +0000 (10:04 -0400)
committerAlfredo Deza <adeza@redhat.com>
Tue, 2 Jun 2015 14:07:17 +0000 (10:07 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph-deploy/build/build

index d95fb573aa0f079373c5d31a6442e24be6479968..c65d95f05993b0ead1fc706e3ab3cbbced4ed230 100644 (file)
@@ -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