From 7c1d49e356dbcdc5a9fe8771b8b93336aa3d3dbe Mon Sep 17 00:00:00 2001 From: Scott Little Date: Wed, 1 Aug 2018 15:38:25 -0400 Subject: [PATCH] Relocate python-psycopg2 to stx-integ/database/python-psycopg2 Move content from stx-gplv3 into stx-integ Packages will be relocated to stx-integ: base/ anaconda crontabs dnsmasq rsync database/ python-psycopg2 filesystem/ parted grub/ grub2 security/ python-keyring Change-Id: Ib5664fc4b8820590d77e32909674461209ceb699 Story: 2002801 Task: 22687 Signed-off-by: Scott Little --- centos_pkg_dirs | 1 + .../python-psycopg2/centos/build_srpm.data | 2 + .../centos/meta_patches/PATCH_ORDER | 2 + .../centos/meta_patches/meta-patch0.patch | 33 +++++++ .../meta_patches/setup-spec-for-tis.patch | 25 +++++ ...nually-patch-170-173-187-and-187-fix.patch | 96 +++++++++++++++++++ database/python-psycopg2/centos/srpm_path | 2 + 7 files changed, 161 insertions(+) create mode 100644 database/python-psycopg2/centos/build_srpm.data create mode 100644 database/python-psycopg2/centos/meta_patches/PATCH_ORDER create mode 100644 database/python-psycopg2/centos/meta_patches/meta-patch0.patch create mode 100644 database/python-psycopg2/centos/meta_patches/setup-spec-for-tis.patch create mode 100644 database/python-psycopg2/centos/patches/Manually-patch-170-173-187-and-187-fix.patch create mode 100644 database/python-psycopg2/centos/srpm_path diff --git a/centos_pkg_dirs b/centos_pkg_dirs index 541adb161..675626810 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -139,3 +139,4 @@ networking/net-tools filesystem/drbd/drbd-tools database/mariadb networking/iptables +database/python-psycopg2 diff --git a/database/python-psycopg2/centos/build_srpm.data b/database/python-psycopg2/centos/build_srpm.data new file mode 100644 index 000000000..f26198008 --- /dev/null +++ b/database/python-psycopg2/centos/build_srpm.data @@ -0,0 +1,2 @@ +TIS_PATCH_VER=2 + diff --git a/database/python-psycopg2/centos/meta_patches/PATCH_ORDER b/database/python-psycopg2/centos/meta_patches/PATCH_ORDER new file mode 100644 index 000000000..84f9de3a3 --- /dev/null +++ b/database/python-psycopg2/centos/meta_patches/PATCH_ORDER @@ -0,0 +1,2 @@ +setup-spec-for-tis.patch +meta-patch0.patch diff --git a/database/python-psycopg2/centos/meta_patches/meta-patch0.patch b/database/python-psycopg2/centos/meta_patches/meta-patch0.patch new file mode 100644 index 000000000..bec98c2ae --- /dev/null +++ b/database/python-psycopg2/centos/meta_patches/meta-patch0.patch @@ -0,0 +1,33 @@ +From f964faeb50150b64ed2481f721e544f4c3e2ca55 Mon Sep 17 00:00:00 2001 +From: Al Bailey +Date: Tue, 29 Nov 2016 15:06:32 -0500 +Subject: [PATCH 1/1] meta patch0 + +--- + SPECS/python-psycopg2.spec | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/SPECS/python-psycopg2.spec b/SPECS/python-psycopg2.spec +index 2489fc5..c11a680 100644 +--- a/SPECS/python-psycopg2.spec ++++ b/SPECS/python-psycopg2.spec +@@ -36,6 +36,8 @@ Url: http://www.psycopg.org/psycopg/ + + Source0: http://www.psycopg.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-%{version}.tar.gz + ++Patch0: Manually-patch-170-173-187-and-187-fix.patch ++ + BuildRequires: postgresql-devel + BuildRequires: python-devel + BuildRequires: python-debug +@@ -103,6 +105,7 @@ Zope Database Adapter for PostgreSQL, called ZPsycopgDA + + %prep + %setup -q -n psycopg2-%{version} ++%patch0 -p1 + + %build + for python in %{python_runtimes} ; do +-- +1.8.3.1 + diff --git a/database/python-psycopg2/centos/meta_patches/setup-spec-for-tis.patch b/database/python-psycopg2/centos/meta_patches/setup-spec-for-tis.patch new file mode 100644 index 000000000..dfbb34544 --- /dev/null +++ b/database/python-psycopg2/centos/meta_patches/setup-spec-for-tis.patch @@ -0,0 +1,25 @@ +From 78314a11e44751d23da70c5b935c73579650a2bd Mon Sep 17 00:00:00 2001 +From: Al Bailey +Date: Tue, 29 Nov 2016 14:29:21 -0500 +Subject: [PATCH 1/1] Setup spec for Titanium Cloud + +--- + SPECS/python-psycopg2.spec | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/SPECS/python-psycopg2.spec b/SPECS/python-psycopg2.spec +index 8492914..2489fc5 100644 +--- a/SPECS/python-psycopg2.spec ++++ b/SPECS/python-psycopg2.spec +@@ -28,7 +28,7 @@ + Summary: A PostgreSQL database adapter for Python + Name: python-psycopg2 + Version: 2.5.1 +-Release: 3%{?dist} ++Release: 3.el7%{?_tis_dist}.%{tis_patch_ver} + # The exceptions allow linking to OpenSSL and PostgreSQL's libpq + License: LGPLv3+ with exceptions + Group: Applications/Databases +-- +1.8.3.1 + diff --git a/database/python-psycopg2/centos/patches/Manually-patch-170-173-187-and-187-fix.patch b/database/python-psycopg2/centos/patches/Manually-patch-170-173-187-and-187-fix.patch new file mode 100644 index 000000000..e4a88c49d --- /dev/null +++ b/database/python-psycopg2/centos/patches/Manually-patch-170-173-187-and-187-fix.patch @@ -0,0 +1,96 @@ +From 04fe7ce2bed4b20ffa89d12551bd2865d21caec1 Mon Sep 17 00:00:00 2001 +From: Al Bailey +Date: Tue, 29 Nov 2016 14:52:47 -0500 +Subject: [PATCH 1/1] Manually patch 170,173,187 and 187 fix + +--- + psycopg/connection_int.c | 7 ++++++- + psycopg/error_type.c | 12 ++++++++++-- + psycopg/lobject_type.c | 15 +++++++++------ + 3 files changed, 25 insertions(+), 9 deletions(-) + +diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c +index 7851b0a..5069e64 100644 +--- a/psycopg/connection_int.c ++++ b/psycopg/connection_int.c +@@ -642,6 +642,7 @@ static int + _conn_poll_connecting(connectionObject *self) + { + int res = PSYCO_POLL_ERROR; ++ const char *msg; + + Dprintf("conn_poll: poll connecting"); + switch (PQconnectPoll(self->pgconn)) { +@@ -656,7 +657,11 @@ _conn_poll_connecting(connectionObject *self) + break; + case PGRES_POLLING_FAILED: + case PGRES_POLLING_ACTIVE: +- PyErr_SetString(OperationalError, "asynchronous connection failed"); ++ msg = PQerrorMessage(self->pgconn); ++ if (!(msg && *msg)) { ++ msg = "asynchronous connection failed"; ++ } ++ PyErr_SetString(OperationalError, msg); + res = PSYCO_POLL_ERROR; + break; + } +diff --git a/psycopg/error_type.c b/psycopg/error_type.c +index 106b87a..75761e8 100644 +--- a/psycopg/error_type.c ++++ b/psycopg/error_type.c +@@ -163,8 +163,16 @@ psyco_error_reduce(errorObject *self) + if (2 != PyTuple_GET_SIZE(tuple)) { goto exit; } + + if (!(dict = PyDict_New())) { goto error; } +- if (0 != PyDict_SetItemString(dict, "pgerror", self->pgerror)) { goto error; } +- if (0 != PyDict_SetItemString(dict, "pgcode", self->pgcode)) { goto error; } ++ if (self->pgerror) { ++ if (0 != PyDict_SetItemString(dict, "pgerror", self->pgerror)) { ++ goto error; ++ } ++ } ++ if (self->pgcode) { ++ if (0 != PyDict_SetItemString(dict, "pgcode", self->pgcode)) { ++ goto error; ++ } ++ } + + { + PyObject *newtuple; +diff --git a/psycopg/lobject_type.c b/psycopg/lobject_type.c +index fee11c4..823a1b7 100644 +--- a/psycopg/lobject_type.c ++++ b/psycopg/lobject_type.c +@@ -355,9 +355,11 @@ lobject_dealloc(PyObject* obj) + { + lobjectObject *self = (lobjectObject *)obj; + +- if (lobject_close(self) < 0) +- PyErr_Print(); +- Py_XDECREF((PyObject*)self->conn); ++ if (self->conn) { /* if not, init failed */ ++ if (lobject_close(self) < 0) ++ PyErr_Print(); ++ Py_XDECREF((PyObject*)self->conn); ++ } + PyMem_Free(self->smode); + + Dprintf("lobject_dealloc: deleted lobject object at %p, refcnt = " +@@ -372,10 +374,11 @@ lobject_init(PyObject *obj, PyObject *args, PyObject *kwds) + int oid = (int)InvalidOid, new_oid = (int)InvalidOid; + const char *smode = ""; + const char *new_file = NULL; +- PyObject *conn; ++ PyObject *conn = NULL; + +- if (!PyArg_ParseTuple(args, "O|iziz", +- &conn, &oid, &smode, &new_oid, &new_file)) ++ if (!PyArg_ParseTuple(args, "O!|iziz", ++ &connectionType, &conn, ++ &oid, &smode, &new_oid, &new_file)) + return -1; + + return lobject_setup((lobjectObject *)obj, +-- +1.8.3.1 + diff --git a/database/python-psycopg2/centos/srpm_path b/database/python-psycopg2/centos/srpm_path new file mode 100644 index 000000000..02f3299ab --- /dev/null +++ b/database/python-psycopg2/centos/srpm_path @@ -0,0 +1,2 @@ +mirror:Source/python-psycopg2-2.5.1-3.el7.src.rpm +