From 42c9f507be4a9fe423be5ae818fb8d284ffccf5e Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sun, 17 Jan 2021 09:34:19 +0100 Subject: [PATCH] Fixup compatibility of kojid with koji-hub 1.21 Signed-off-by: Igor Raits --- 2649.patch | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ koji.spec | 6 +++++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 2649.patch diff --git a/2649.patch b/2649.patch new file mode 100644 index 0000000..536e8e0 --- /dev/null +++ b/2649.patch @@ -0,0 +1,51 @@ +From 7675881c5481d7157c64c6a2a008fac7fbf5c495 Mon Sep 17 00:00:00 2001 +From: Tomas Kopecek +Date: Jan 15 2021 11:56:31 +0000 +Subject: [PATCH 1/2] kojid: backward compatible hub call + + +Fixes: https://pagure.io/koji/issue/2648 + +--- + +diff --git a/builder/kojid b/builder/kojid +index 7f4557a..ca33a00 100755 +--- a/builder/kojid ++++ b/builder/kojid +@@ -1328,7 +1328,12 @@ class BuildArchTask(BaseBuildTask): + weight is scaled from a minimum of 1.5 to a maximum of 6, based on + the average duration of a build of this package. + """ +- avg = self.session.getAverageBuildDuration(name, age=6) ++ try: ++ avg = self.session.getAverageBuildDuration(name, age=6) ++ except ParameterError: ++ # for hub < 1.23 ++ avg = self.session.getAverageBuildDuration(name) ++ + if not avg: + return + if avg < 0: + +From a53aa56b87a569ccb8eb3173f7eddfe86b2dfea2 Mon Sep 17 00:00:00 2001 +From: Tomas Kopecek +Date: Jan 15 2021 15:23:44 +0000 +Subject: [PATCH 2/2] typo + + +--- + +diff --git a/builder/kojid b/builder/kojid +index ca33a00..b503405 100755 +--- a/builder/kojid ++++ b/builder/kojid +@@ -1330,7 +1330,7 @@ class BuildArchTask(BaseBuildTask): + """ + try: + avg = self.session.getAverageBuildDuration(name, age=6) +- except ParameterError: ++ except koji.ParameterError: + # for hub < 1.23 + avg = self.session.getAverageBuildDuration(name) + + diff --git a/koji.spec b/koji.spec index e7a719d..169a3ae 100644 --- a/koji.spec +++ b/koji.spec @@ -9,7 +9,7 @@ Name: koji Version: 1.23.0 -Release: 2%{?dist} +Release: 3%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools @@ -18,6 +18,7 @@ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 # Patches already upstream Patch1: https://pagure.io/koji/pull-request/2579.patch +Patch2: https://pagure.io/koji/pull-request/2649.patch # Not upstreamable Patch100: fedora-config.patch @@ -339,6 +340,9 @@ done %systemd_postun kojira.service %changelog +* Sun Jan 17 2021 Igor Raits - 1.23.0-3 +- Fixup compatibility of kojid with koji-hub 1.21 + * Mon Nov 30 2020 Kevin Fenzi - 1.23.0-2 - Fix 32 bit arm install issue. Fixes bug #1894261