SHA256
1
0
forked from pool/pagure

Accepting request 1195176 from devel:tools:scm

- Add pagure-pygit2.patch to repair service startup on Leap 15.6 and Tumbleweed

OBS-URL: https://build.opensuse.org/request/show/1195176
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/pagure?expand=0&rev=27
This commit is contained in:
Ana Guerrero 2024-08-22 16:13:20 +00:00 committed by Git OBS Bridge
commit 94cd97a980
3 changed files with 47 additions and 3 deletions

39
pagure-pygit2.patch Normal file
View File

@ -0,0 +1,39 @@
commit 8a1a7ba9f789ba446bab63783f7b963246861cb8
Author: Dominik Wombacher <dominik@wombacher.cc>
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

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sat Aug 17 11:28:25 UTC 2024 - Georg Pfuetzenreuter <mail+rpm@georg-pfuetzenreuter.net>
- Add pagure-pygit2.patch to repair service startup on Leap 15.6 and Tumbleweed
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Jun 2 09:16:20 UTC 2024 - Dominik Wombacher <dominik@wombacher.cc> Sun Jun 2 09:16:20 UTC 2024 - Dominik Wombacher <dominik@wombacher.cc>

View File

@ -47,11 +47,11 @@ Source10: pagure-README.SUSE
Patch1000: pagure-5.0-default-example-cfg.patch 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. # 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 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 BuildArch: noarch
BuildRequires: apache2 BuildRequires: apache2
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: nginx BuildRequires: nginx
@ -234,7 +234,7 @@ Conflicts: %{name}-theme-default
Provides: %{name}-theme-default Provides: %{name}-theme-default
Requires: %{name}-theme-chameleon = %{version}-%{release} Requires: %{name}-theme-chameleon = %{version}-%{release}
Enhances: (%{name} and branding-openSUSE) Enhances: (%{name} and branding-openSUSE)
Removepathpostfixes:.openSUSE Removepathpostfixes: .openSUSE
%description theme-default-openSUSE %description theme-default-openSUSE
This package sets the default web interface assets used for This package sets the default web interface assets used for