]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
scripts/build_utils.sh: Add get_distro_and_target function
authorBoris Ranto <branto@redhat.com>
Mon, 31 Oct 2016 14:45:56 +0000 (15:45 +0100)
committerBoris Ranto <branto@redhat.com>
Tue, 1 Nov 2016 12:39:19 +0000 (13:39 +0100)
This is a more generic function that will set DISTRO variable and
MOCK_TARGET variable (rpm systems only).

Signed-off-by: Boris Ranto <branto@redhat.com>
scripts/build_utils.sh

index 2c716d95eab549c33999b5948c0e22589e421d26..b2f229a850b159256ab48dfb263e62cbbda7cbb1 100644 (file)
@@ -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
+}