Blame SOURCES/0022-copr-allow-specifying-protocol-as-part-of-hub.patch

92f559
From b2d019658ebb40606e1a9efcb2233a8e38834410 Mon Sep 17 00:00:00 2001
92f559
From: Alexander Sosedkin <asosedkin@redhat.com>
92f559
Date: Thu, 7 Oct 2021 19:08:47 +0200
92f559
Subject: [PATCH] copr: allow specifying protocol as part of --hub
92f559
92f559
This way it doesn't try to connect to
92f559
https://http//url if --hub started with http://.
92f559
---
92f559
 plugins/copr.py | 8 ++++++--
92f559
 1 file changed, 6 insertions(+), 2 deletions(-)
92f559
92f559
diff --git a/plugins/copr.py b/plugins/copr.py
92f559
index 721c010..297210b 100644
92f559
--- a/plugins/copr.py
92f559
+++ b/plugins/copr.py
92f559
@@ -198,8 +198,12 @@ class CoprCommand(dnf.cli.Command):
92f559
                     self.copr_hostname += ":" + port
92f559
 
92f559
         if not self.copr_url:
92f559
-            self.copr_hostname = copr_hub
92f559
-            self.copr_url = self.default_protocol + "://" + copr_hub
92f559
+            if '://' not in copr_hub:
92f559
+                self.copr_hostname = copr_hub
92f559
+                self.copr_url = self.default_protocol + "://" + copr_hub
92f559
+            else:
92f559
+                self.copr_hostname = copr_hub.split('://', 1)[1]
92f559
+                self.copr_url = copr_hub
92f559
 
92f559
     def _read_config_item(self, config, hub, section, default):
92f559
         try:
92f559
-- 
92f559
2.36.1
92f559