File 0001-copr-Add-openSUSE-support.patch of Package dnf-plugins-core

From 802458aded0964633f8f97a15477a1857753b943 Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com>
Date: Sun, 22 Apr 2018 14:00:56 -0400
Subject: [PATCH] copr: Add openSUSE support

This is based on the following upstream commits:

* d3854bbf84955a72f444d4c6442d49bd24b424c0
* 19fb75d15f61432ab5fb7be7adc5f5ae62c11d12
---
 plugins/copr.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/plugins/copr.py b/plugins/copr.py
index 2546d03..b9c70d5 100644
--- a/plugins/copr.py
+++ b/plugins/copr.py
@@ -300,6 +300,14 @@ Do you want to continue?""")
                 chroot = ("mageia-cauldron-{}".format(distarch))
             else:
                 chroot = ("mageia-{0}-{1}".format(dist[1], distarch))
+        elif "openSUSE" in dist:
+            # Get distribution architecture (openSUSE does not use $basearch)
+            distarch = rpm.expandMacro("%{_target_cpu}")
+            # Set the chroot
+            if "Tumbleweed" in dist:
+                chroot = ("opensuse-tumbleweed-{}".format(distarch))
+            else:
+                chroot = ("opensuse-leap-{0}-{1}".format(dist[1], distarch))
         else:
             chroot = ("epel-%s-x86_64" % dist[1].split(".", 1)[0])
         return chroot
-- 
2.14.3

openSUSE Build Service is sponsored by