Module: check_mk
Branch: master
Commit: b2f826ee2ee6f67cd5ace068d7a2e0c22d962c01
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b2f826ee2ee6f6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Apr 20 18:15:37 2018 +0200
Fix psycopg2 build with Ubuntu 18.04
Change-Id: I5382748f2f58118a1aa30b541b93eed69fb7533c
---
...0016-make-psycopg2-build-with-ubuntu-bionic.dif | 31 ++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git
a/omd/packages/python-modules/patches/0016-make-psycopg2-build-with-ubuntu-bionic.dif
b/omd/packages/python-modules/patches/0016-make-psycopg2-build-with-ubuntu-bionic.dif
new file mode 100644
index 0000000..a1118e3
--- /dev/null
+++ b/omd/packages/python-modules/patches/0016-make-psycopg2-build-with-ubuntu-bionic.dif
@@ -0,0 +1,31 @@
+diff -Nur dest.orig/psycopg2-2.6.2/setup.py dest/psycopg2-2.6.2/setup.py
+--- dest.orig/psycopg2-2.6.2/setup.py 2016-07-07 02:16:24.000000000 +0000
++++ dest/psycopg2-2.6.2/setup.py 2018-04-20 16:11:18.575206167 +0000
+@@ -410,19 +410,24 @@
+ 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)
++ # Postgres >= 10 doesn't have pgminor anymore.
++ pgmajor = int(pgmajor)
++ if pgmajor >= 10:
++ pgminor, pgpatch = None, pgminor
++ if pgminor is None or not pgminor.isdigit():
++ pgminor = 0
+ if pgpatch is None or not pgpatch.isdigit():
+ pgpatch = 0
+- pgmajor = int(pgmajor)
+ pgminor = int(pgminor)
+ pgpatch = int(pgpatch)
+ else:
+ sys.stderr.write(
+ "Error: could not determine PostgreSQL version from
'%s'"
+- % pgversion)
++ % pgversion)
+ sys.exit(1)
+
+ define_macros.append(("PG_VERSION_HEX", "0x%02X%02X%02X"
%))