diff --git a/pagure-pygit2.patch b/pagure-pygit2.patch new file mode 100644 index 0000000..5fd79b8 --- /dev/null +++ b/pagure-pygit2.patch @@ -0,0 +1,39 @@ +commit 8a1a7ba9f789ba446bab63783f7b963246861cb8 +Author: Dominik Wombacher +Date: Tue Apr 16 18:17:03 2024 +0000 + + tests: Fix issue 'No module named pygit2.remote' +diff '--color=auto' -ur a/pagure/lib/git.py b/pagure/lib/git.py +--- a/pagure/lib/git.py 2024-05-24 16:43:47.000000000 +0200 ++++ b/pagure/lib/git.py 2024-08-17 13:39:06.096428774 +0200 +@@ -33,8 +33,10 @@ + + from sqlalchemy.exc import SQLAlchemyError + +-# from sqlalchemy.orm.session import Session +-from pygit2.remote import RemoteCollection ++try: ++ from pygit2.remote import RemoteCollection ++except ImportError: ++ from pygit2.remotes import RemoteCollection + + import pagure.utils + import pagure.exceptions +diff '--color=auto' -ur a/tests/test_pagure_lib_git.py b/tests/test_pagure_lib_git.py +--- a/tests/test_pagure_lib_git.py 2024-05-24 16:43:47.000000000 +0200 ++++ b/tests/test_pagure_lib_git.py 2024-08-17 13:35:21.848131790 +0200 +@@ -3645,8 +3645,12 @@ + + # make sure the function works fine even if there's a leftover + # ref from previous failed run of the function +- with patch("pygit2.remote.RemoteCollection.delete"): +- pagure.lib.git.update_pull_ref(fake_pr, fork) ++ try: ++ with patch("pygit2.remote.RemoteCollection.delete"): ++ pagure.lib.git.update_pull_ref(fake_pr, fork) ++ except ImportError: ++ with patch("pygit2.remotes.RemoteCollection.delete"): ++ pagure.lib.git.update_pull_ref(fake_pr, fork) + self.assertIsNotNone(fork.remotes["pingou_1234567"]) + tests.add_content_git_repo(projects[1], append="foobarbaz") + newesthex = fork.references["refs/heads/master"].peel().hex diff --git a/pagure.changes b/pagure.changes index c22e4fc..b915f55 100644 --- a/pagure.changes +++ b/pagure.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Aug 17 11:28:25 UTC 2024 - Georg Pfuetzenreuter + +- Add pagure-pygit2.patch to repair service startup on Leap 15.6 and Tumbleweed + ------------------------------------------------------------------- Sun Jun 2 09:16:20 UTC 2024 - Dominik Wombacher diff --git a/pagure.spec b/pagure.spec index 05cb967..045e95c 100644 --- a/pagure.spec +++ b/pagure.spec @@ -47,11 +47,11 @@ Source10: pagure-README.SUSE Patch1000: pagure-5.0-default-example-cfg.patch # PATCH-FIX-UPSTREAM 5486.patch https://pagure.io/pagure/pull-request/5486 dominik@wombacher.cc -- Use '==' instead of 'is' in template if condition because to work with older Jinja2 versions. Edge case, avoid 'KeyError' after pagure update if a cached session is used. Patch1001: 5486.patch - +# PATCH-FIX-UPSTREAM pagure-pygit2.patch -- PyGit2 renamed its files: https://github.com/libgit2/pygit2/commit/a8b2421bea55029296cc79ac7c1518b9885d8a6f +Patch1002: pagure-pygit2.patch BuildArch: noarch - BuildRequires: apache2 BuildRequires: fdupes BuildRequires: nginx @@ -234,7 +234,7 @@ Conflicts: %{name}-theme-default Provides: %{name}-theme-default Requires: %{name}-theme-chameleon = %{version}-%{release} Enhances: (%{name} and branding-openSUSE) -Removepathpostfixes:.openSUSE +Removepathpostfixes: .openSUSE %description theme-default-openSUSE This package sets the default web interface assets used for