From c7a8698be74cdc4993757fa33e1b68a342e8193a Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Tue, 5 Nov 2024 14:56:52 +0100 Subject: [PATCH] Fix symlink_if_latest() logic Currently, the latest symlink is never updated. --- 0001-repos-check-for-newer-create-event.patch | 25 +++++++++++++++++++ koji.spec | 4 ++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 0001-repos-check-for-newer-create-event.patch diff --git a/0001-repos-check-for-newer-create-event.patch b/0001-repos-check-for-newer-create-event.patch new file mode 100644 index 0000000..8f227cd --- /dev/null +++ b/0001-repos-check-for-newer-create-event.patch @@ -0,0 +1,25 @@ +From a0498970e73384a3bce62bc28f5f98f4feeabaff Mon Sep 17 00:00:00 2001 +From: Igor Raits +Date: Nov 05 2024 13:53:22 +0000 +Subject: repos: check for newer create event + + +When the repo was just created, it has create_event that is the same as +we are checking so the repo will never be considered latest. + +--- + +diff --git a/kojihub/repos.py b/kojihub/repos.py +index 5fc08ed..9a7fd03 100644 +--- a/kojihub/repos.py ++++ b/kojihub/repos.py +@@ -333,7 +333,7 @@ def symlink_if_latest(repo): + clauses = [ + ['tag_id', '=', repo['tag_id']], + ['state', '=', koji.REPO_READY], +- ['create_event', '>=', repo['create_event']]] ++ ['create_event', '>', repo['create_event']]] + if repo['dist']: + clauses.append(['dist', 'IS', True]) + else: + diff --git a/koji.spec b/koji.spec index 838eac0..f79a4af 100644 --- a/koji.spec +++ b/koji.spec @@ -9,7 +9,7 @@ Name: koji Version: 1.35.1 -Release: 2%{?dist} +Release: 3%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ # Automatically converted from old format: LGPLv2 and GPLv2+ - review is highly recommended. License: LicenseRef-Callaway-LGPLv2 AND GPL-2.0-or-later @@ -17,6 +17,8 @@ Summary: Build system tools URL: https://pagure.io/koji/ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 +Patch1: https://pagure.io/koji/pull-request/4258.patch#/0001-repos-check-for-newer-create-event.patch + # Not upstreamable Patch100: fedora-config.patch Patch101: pr4228-wait-repo-current.patch