From: Boris Ranto Date: Mon, 31 Oct 2016 14:45:56 +0000 (+0100) Subject: scripts/build_utils.sh: Add get_distro_and_target function X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b6c5facfb89845d5fdc4183a5ee8d59586a43c98;p=ceph-build.git scripts/build_utils.sh: Add get_distro_and_target function This is a more generic function that will set DISTRO variable and MOCK_TARGET variable (rpm systems only). Signed-off-by: Boris Ranto --- diff --git a/scripts/build_utils.sh b/scripts/build_utils.sh index 2c716d95..b2f229a8 100644 --- a/scripts/build_utils.sh +++ b/scripts/build_utils.sh @@ -275,3 +275,32 @@ failed_build_status() { submit_build_status "POST" $state $project $distro $distro_version $distro_arch } + + +get_distro_and_target() { + # Get distro from DIST for chacra uploads + DISTRO="" + case $DIST in + jessie|wheezy) + DISTRO="debian" + ;; + xenial|precise|trusty) + DISTRO="ubuntu" + ;; + centos*) + DISTRO="centos" + MOCK_TARGET="epel" + ;; + rhel*) + DISTRO="rhel" + MOCK_TARGET="epel" + ;; + fedora*) + DISTRO="fedora" + MOCK_TARGET="fedora" + ;; + *) + DISTRO="unknown" + ;; + esac +}