Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 May 2020 14:01:39 +0000 (UTC)
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r536298 - in head/databases/pglogical: . files
Message-ID:  <202005231401.04NE1d6a099292@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: matthew
Date: Sat May 23 14:01:39 2020
New Revision: 536298
URL: https://svnweb.freebsd.org/changeset/ports/536298

Log:
  Fix build after upstream changes in postgres 9.5 -- 12 made functions
  AcquireDeletionLock() and ReleaseDeletionLock() extern rather than
  static in:
  
     https://github.com/postgres/postgres/commit/5be594caf818e0b5e33f8dec191f2707394a6d95
  
  The function definitions in the postgresql sources are identical to
  those in the pglogical sources, so let's just link against the
  postgresql versions.
  
  postgresql-9.4 is EoL, so didn't receive the same changes in the
  latest round of postgresql updates.
  
  While here, fix another of the patches which should no be applied when
  compiling against all versions of postgresql.  Plus fix the pkg-plist
  -- how did this port ever package previously?

Added:
  head/databases/pglogical/files/extra-patch-pglogical__dependency.c   (contents, props changed)
  head/databases/pglogical/files/patch-pglogical__apply__spi.c
     - copied unchanged from r536297, head/databases/pglogical/files/extra-patch-pglogical__apply__spi.c
Deleted:
  head/databases/pglogical/files/extra-patch-pglogical__apply__spi.c
Modified:
  head/databases/pglogical/Makefile
  head/databases/pglogical/pkg-plist

Modified: head/databases/pglogical/Makefile
==============================================================================
--- head/databases/pglogical/Makefile	Sat May 23 13:02:35 2020	(r536297)
+++ head/databases/pglogical/Makefile	Sat May 23 14:01:39 2020	(r536298)
@@ -4,6 +4,7 @@
 PORTNAME=	pglogical
 DISTVERSIONPREFIX=	REL
 DISTVERSION=	2_3_1
+PORTREVISION=	1
 CATEGORIES=	databases
 
 MAINTAINER=	matthew@FreeBSD.org
@@ -35,9 +36,13 @@ PLIST_SUB+=	PGSQL94=""
 PLIST_SUB+=	PGSQL94="@comment "
 .endif
 
-.if ${PGSQL_VER} >= 11
-EXTRA_PATCHES=	${PATCHDIR}/extra-patch-pglogical__apply__spi.c
+.if ${PGSQL_VER} >= 9.5
+EXTRA_PATCHES=	${PATCHDIR}/extra-patch-pglogical__dependency.c
 .endif
+
+#.if ${PGSQL_VER} >= 11
+#EXTRA_PATCHES+=	${PATCHDIR}/extra-patch-pglogical__apply__spi.c
+#.endif
 
 # FFI
 #TEST_DEPENDS=	pg_regress:databases/postgresql${PGSQL_VER_NODOT}-pg_regress

Added: head/databases/pglogical/files/extra-patch-pglogical__dependency.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/pglogical/files/extra-patch-pglogical__dependency.c	Sat May 23 14:01:39 2020	(r536298)
@@ -0,0 +1,63 @@
+--- pglogical_dependency.c.orig	2020-04-06 19:40:00 UTC
++++ pglogical_dependency.c
+@@ -232,8 +232,6 @@ static void reportDependentObjects(const ObjectAddress
+ 					   DropBehavior behavior,
+ 					   int msglevel,
+ 					   const ObjectAddress *origObject);
+-static void AcquireDeletionLock(const ObjectAddress *object, int flags);
+-static void ReleaseDeletionLock(const ObjectAddress *object);
+ static bool find_expr_references_walker(Node *node,
+ 							find_expr_references_context *context);
+ static void eliminate_duplicate_dependencies(ObjectAddresses *addrs);
+@@ -926,51 +924,6 @@ reportDependentObjects(const ObjectAddresses *targetOb
+ 
+ 	pfree(clientdetail.data);
+ 	pfree(logdetail.data);
+-}
+-
+-/*
+- * AcquireDeletionLock - acquire a suitable lock for deleting an object
+- *
+- * We use LockRelation for relations, LockDatabaseObject for everything
+- * else.  Note that dependency.c is not concerned with deleting any kind of
+- * shared-across-databases object, so we have no need for LockSharedObject.
+- */
+-static void
+-AcquireDeletionLock(const ObjectAddress *object, int flags)
+-{
+-	if (object->classId == RelationRelationId)
+-	{
+-		/*
+-		 * In DROP INDEX CONCURRENTLY, take only ShareUpdateExclusiveLock on
+-		 * the index for the moment.  index_drop() will promote the lock once
+-		 * it's safe to do so.  In all other cases we need full exclusive
+-		 * lock.
+-		 */
+-		if (flags & PERFORM_DELETION_CONCURRENTLY)
+-			LockRelationOid(object->objectId, ShareUpdateExclusiveLock);
+-		else
+-			LockRelationOid(object->objectId, AccessExclusiveLock);
+-	}
+-	else
+-	{
+-		/* assume we should lock the whole object not a sub-object */
+-		LockDatabaseObject(object->classId, object->objectId, 0,
+-						   AccessExclusiveLock);
+-	}
+-}
+-
+-/*
+- * ReleaseDeletionLock - release an object deletion lock
+- */
+-static void
+-ReleaseDeletionLock(const ObjectAddress *object)
+-{
+-	if (object->classId == RelationRelationId)
+-		UnlockRelationOid(object->objectId, AccessExclusiveLock);
+-	else
+-		/* assume we should lock the whole object not a sub-object */
+-		UnlockDatabaseObject(object->classId, object->objectId, 0,
+-							 AccessExclusiveLock);
+ }
+ 
+ /*

Copied: head/databases/pglogical/files/patch-pglogical__apply__spi.c (from r536297, head/databases/pglogical/files/extra-patch-pglogical__apply__spi.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/pglogical/files/patch-pglogical__apply__spi.c	Sat May 23 14:01:39 2020	(r536298, copy of r536297, head/databases/pglogical/files/extra-patch-pglogical__apply__spi.c)
@@ -0,0 +1,10 @@
+--- pglogical_apply_spi.c.orig	2019-03-06 06:44:31 UTC
++++ pglogical_apply_spi.c
+@@ -16,6 +16,7 @@
+  */
+ #include <stdio.h>
+ #include <unistd.h>
++#include <arpa/inet.h>
+ 
+ #include "postgres.h"
+ 

Modified: head/databases/pglogical/pkg-plist
==============================================================================
--- head/databases/pglogical/pkg-plist	Sat May 23 13:02:35 2020	(r536297)
+++ head/databases/pglogical/pkg-plist	Sat May 23 14:01:39 2020	(r536298)
@@ -21,8 +21,11 @@ share/postgresql/extension/pglogical--2.2.0.sql
 share/postgresql/extension/pglogical--2.2.1--2.2.2.sql
 share/postgresql/extension/pglogical--2.2.1.sql
 share/postgresql/extension/pglogical--2.2.2--2.3.0.sql
+share/postgresql/extension/pglogical--2.2.2--2.3.1.sql
 share/postgresql/extension/pglogical--2.2.2.sql
+share/postgresql/extension/pglogical--2.3.0--2.3.1.sql
 share/postgresql/extension/pglogical--2.3.0.sql
+share/postgresql/extension/pglogical--2.3.1.sql
 share/postgresql/extension/pglogical.control
 share/postgresql/extension/pglogical_origin--1.0.0.sql
 share/postgresql/extension/pglogical_origin.control



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005231401.04NE1d6a099292>