14
0

- Add allow-rc-versions.patch to fix build with 15rc2 pg version

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psycopg2cffi?expand=0&rev=6
This commit is contained in:
2022-10-14 08:15:05 +00:00
committed by Git OBS Bridge
parent b41bf8a65f
commit 24ede1fb22
3 changed files with 28 additions and 2 deletions

19
allow-rc-versions.patch Normal file
View File

@@ -0,0 +1,19 @@
Index: psycopg2cffi-2.9.0/psycopg2cffi/_impl/_build_libpq.py
===================================================================
--- psycopg2cffi-2.9.0.orig/psycopg2cffi/_impl/_build_libpq.py
+++ psycopg2cffi-2.9.0/psycopg2cffi/_impl/_build_libpq.py
@@ -152,10 +152,12 @@ Please add the directory containing pg_c
pgversion = '7.4.0'
verre = re.compile(
- r'(\d+)\.(\d+)(?:(?:\.(\d+))|(devel|(alpha|beta|rc)\d+)?)')
+ r'(\d+)(\.(\d+))?(?:(?:\.(\d+))|(devel|(alpha|beta|rc)\d+)?)')
m = verre.match(pgversion)
if m:
- pgmajor, pgminor, pgpatch = m.group(1, 2, 3)
+ pgmajor, pgminor, pgpatch = m.group(1, 3, 4)
+ if pgminor is None or not pgminor.isdigit():
+ pgminor = 0
if pgpatch is None or not pgpatch.isdigit():
pgpatch = 0
else:

View File

@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Oct 14 08:13:54 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Add allow-rc-versions.patch to fix build with 15rc2 pg version
-------------------------------------------------------------------
Tue Oct 12 10:18:07 UTC 2021 - ecsos <ecsos@opensuse.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-psycopg2cffi
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@ Summary: Implementation of the psycopg2 module using cffi
License: LGPL-3.0-or-later
URL: https://github.com/chtd/psycopg2cffi
Source: https://files.pythonhosted.org/packages/source/p/psycopg2cffi/psycopg2cffi-%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE allow-rc-versions.patch to allow 15rc2 pg version
Patch: allow-rc-versions.patch
BuildRequires: %{python_module devel >= 3.5}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@@ -43,7 +45,7 @@ BuildRequires: %{python_module six}
This is a implementation of the psycopg2 module using cffi.
%prep
%setup -q -n psycopg2cffi-%{version}
%autosetup -p1 -n psycopg2cffi-%{version}
%build
export CFLAGS="%{optflags}"