From 3b86654ed959b7958476fd6cad5cac561cc84127 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Tue, 20 Feb 2018 10:13:57 +0100 Subject: [PATCH] Backport PR #796 Signed-off-by: Patrick Uiterwijk --- 796.patch | 28 ++++++++++++++++++++++++++++ koji.spec | 7 ++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 796.patch diff --git a/796.patch b/796.patch new file mode 100644 index 0000000..7a88b55 --- /dev/null +++ b/796.patch @@ -0,0 +1,28 @@ +From e45c909235825f22e2ac7da63a4d6454399224e3 Mon Sep 17 00:00:00 2001 +From: Patrick Uiterwijk +Date: Feb 20 2018 09:10:11 +0000 +Subject: Fix comparison with Enum value + + +The CHECKSUM_TYPES[...] call returns the index in the Enum field, not a string, +which meant that the comparison would never work. + +Reported-by: Clement Verna +Signed-off-by: Patrick Uiterwijk + +--- + +diff --git a/hub/kojihub.py b/hub/kojihub.py +index eb9b67d..f910595 100644 +--- a/hub/kojihub.py ++++ b/hub/kojihub.py +@@ -5581,7 +5581,7 @@ class CG_Importer(object): + (filesize, fileinfo['filename'], fileinfo['filesize'])) + + # checksum +- if koji.CHECKSUM_TYPES[fileinfo['checksum_type']] != 'md5': ++ if fileinfo['checksum_type'] != 'md5': + # XXX + # until we change the way we handle checksums, we have to limit this to md5 + raise koji.GenericError("Unsupported checksum type: %(checksum_type)s" % fileinfo) + diff --git a/koji.spec b/koji.spec index 3ae463f..dd49657 100644 --- a/koji.spec +++ b/koji.spec @@ -26,7 +26,7 @@ Name: koji Version: 1.15.0 -Release: 5%{?dist} +Release: 6%{?dist} # koji.ssl libs (from plague) are GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools @@ -38,6 +38,7 @@ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 Patch0: https://pagure.io/koji/pull-request/735.patch Patch1: https://pagure.io/koji/pull-request/794.patch Patch2: koji-fix808.patch +Patch3: https://pagure.io/koji/pull-request/796.patch # Not upstreamable Patch100: fedora-config.patch @@ -246,6 +247,7 @@ koji-web is a web UI to the Koji system. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %patch100 -p1 -b .fedoraconfig %build @@ -448,6 +450,9 @@ fi %endif %changelog +* Tue Feb 20 2018 Patrick Uiterwijk - 1.15.0-6 +- Backport PR #796 + * Sun Feb 18 2018 Patrick Uiterwijk - 1.15.0-5 - Add workaround patch for bug #808