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
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
mkdir -p dist
mv ../*.changes ../*.dsc ../*.deb ../*.tar.gz dist/.
echo "Done"
- ;;
-*)
+
+else
echo "Can't determine build host type"
exit 4
- ;;
-esac
+fi