From 2b12ebf061b7961bc42a83faec938ec4d72c53e6 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 2 Dec 2019 16:38:28 +0000 Subject: move community/postgresql-pglogical -> unmaintained it fails to build with postgresql 12. move to unmaintained to unblock the builders til someone has time to look at it. --- .../001-fix-stdin-handling.patch | 51 ---------------------- community/postgresql-pglogical/APKBUILD | 29 ------------ .../001-fix-stdin-handling.patch | 51 ++++++++++++++++++++++ unmaintained/postgresql-pglogical/APKBUILD | 29 ++++++++++++ 4 files changed, 80 insertions(+), 80 deletions(-) delete mode 100644 community/postgresql-pglogical/001-fix-stdin-handling.patch delete mode 100644 community/postgresql-pglogical/APKBUILD create mode 100644 unmaintained/postgresql-pglogical/001-fix-stdin-handling.patch create mode 100644 unmaintained/postgresql-pglogical/APKBUILD diff --git a/community/postgresql-pglogical/001-fix-stdin-handling.patch b/community/postgresql-pglogical/001-fix-stdin-handling.patch deleted file mode 100644 index 8ba3f6c958b..00000000000 --- a/community/postgresql-pglogical/001-fix-stdin-handling.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/pglogical_apply_spi.c b/pglogical_apply_spi.c -index 3eaccc4..111a4eb 100644 ---- a/pglogical_apply_spi.c -+++ b/pglogical_apply_spi.c -@@ -454,7 +454,7 @@ static void - pglogical_proccess_copy(pglogical_copyState *pglcstate) - { - uint64 processed; -- FILE *save_stdin; -+ int save_stdin; - - if (!pglcstate->copy_parsetree || !pglcstate->copy_buffered_tuples) - return; -@@ -489,8 +489,16 @@ pglogical_proccess_copy(pglogical_copyState *pglcstate) - * for this relation. Before that we save the current 'stdin' stream and - * restore it back when the COPY is done - */ -- save_stdin = stdin; -- stdin = pglcstate->copy_read_file; -+ save_stdin = dup(fileno(stdin)); -+ if (save_stdin < 0) -+ ereport(FATAL, -+ (errcode_for_file_access(), -+ errmsg("could not save stdin: %m"))); -+ -+ if (dup2(fileno(pglcstate->copy_read_file), fileno(stdin)) < 0) -+ ereport(FATAL, -+ (errcode_for_file_access(), -+ errmsg("could not redirect stdin: %m"))); - - /* COPY may call into SPI (triggers, ...) and we already are in SPI. */ - SPI_push(); -@@ -501,10 +509,17 @@ pglogical_proccess_copy(pglogical_copyState *pglcstate) - - /* Clean up SPI state */ - SPI_pop(); -+ /* -+ * Also close the read end of the pipe and restore 'stdin' to its original -+ * value -+ */ -+ if (dup2(save_stdin, fileno(stdin)) < 0) -+ ereport(FATAL, -+ (errcode_for_file_access(), -+ errmsg("could not restore stdin: %m"))); - - fclose(pglcstate->copy_read_file); - pglcstate->copy_read_file = NULL; -- stdin = save_stdin; - - /* Ensure we processed correct number of tuples */ - Assert(processed == pglcstate->copy_buffered_tuples); diff --git a/community/postgresql-pglogical/APKBUILD b/community/postgresql-pglogical/APKBUILD deleted file mode 100644 index 00c6571610f..00000000000 --- a/community/postgresql-pglogical/APKBUILD +++ /dev/null @@ -1,29 +0,0 @@ -# Contributor: Jakub Jirutka -# Contributor: Eugene Pirogov -# Maintainer: Jakub Jirutka -pkgname=postgresql-pglogical -_pkgname=pglogical -pkgver=2.2.1 -pkgrel=0 -pkgdesc="Logical Replication extension for PostgreSQL" -url="https://2ndquadrant.com/en/resources/pglogical/" -arch="all" -license="PostgreSQL" -depends="postgresql" -makedepends="libedit-dev libxml2-dev postgresql-dev zlib-dev" -source="http://packages.2ndquadrant.com/pglogical/tarballs/$_pkgname-$pkgver.tar.bz2 - 001-fix-stdin-handling.patch" -builddir="$srcdir/$_pkgname-$pkgver" - -build() { - cd "$builddir" - make USE_PGXS=1 all -} - -package() { - cd "$builddir" - make USE_PGXS=1 DESTDIR="$pkgdir" install -} - -sha512sums="7526f232e8a69518bb32cba8e9cc06cc18551e9c5747bd73ad443242bb927543faf1c8fc2d70d666aa1059a0b7263d777d4dac0cd708ec98974f0dd0f8d4d1c1 pglogical-2.2.1.tar.bz2 -89df4ed3992f43a0a37eebb5e06dedd2668b6acfad987b3c37e647c05718a9eb0d330d195f4f4426ffc5fad3e1fc7f156c10d3ea6dc7ee778bc2a5b27c6f138f 001-fix-stdin-handling.patch" diff --git a/unmaintained/postgresql-pglogical/001-fix-stdin-handling.patch b/unmaintained/postgresql-pglogical/001-fix-stdin-handling.patch new file mode 100644 index 00000000000..8ba3f6c958b --- /dev/null +++ b/unmaintained/postgresql-pglogical/001-fix-stdin-handling.patch @@ -0,0 +1,51 @@ +diff --git a/pglogical_apply_spi.c b/pglogical_apply_spi.c +index 3eaccc4..111a4eb 100644 +--- a/pglogical_apply_spi.c ++++ b/pglogical_apply_spi.c +@@ -454,7 +454,7 @@ static void + pglogical_proccess_copy(pglogical_copyState *pglcstate) + { + uint64 processed; +- FILE *save_stdin; ++ int save_stdin; + + if (!pglcstate->copy_parsetree || !pglcstate->copy_buffered_tuples) + return; +@@ -489,8 +489,16 @@ pglogical_proccess_copy(pglogical_copyState *pglcstate) + * for this relation. Before that we save the current 'stdin' stream and + * restore it back when the COPY is done + */ +- save_stdin = stdin; +- stdin = pglcstate->copy_read_file; ++ save_stdin = dup(fileno(stdin)); ++ if (save_stdin < 0) ++ ereport(FATAL, ++ (errcode_for_file_access(), ++ errmsg("could not save stdin: %m"))); ++ ++ if (dup2(fileno(pglcstate->copy_read_file), fileno(stdin)) < 0) ++ ereport(FATAL, ++ (errcode_for_file_access(), ++ errmsg("could not redirect stdin: %m"))); + + /* COPY may call into SPI (triggers, ...) and we already are in SPI. */ + SPI_push(); +@@ -501,10 +509,17 @@ pglogical_proccess_copy(pglogical_copyState *pglcstate) + + /* Clean up SPI state */ + SPI_pop(); ++ /* ++ * Also close the read end of the pipe and restore 'stdin' to its original ++ * value ++ */ ++ if (dup2(save_stdin, fileno(stdin)) < 0) ++ ereport(FATAL, ++ (errcode_for_file_access(), ++ errmsg("could not restore stdin: %m"))); + + fclose(pglcstate->copy_read_file); + pglcstate->copy_read_file = NULL; +- stdin = save_stdin; + + /* Ensure we processed correct number of tuples */ + Assert(processed == pglcstate->copy_buffered_tuples); diff --git a/unmaintained/postgresql-pglogical/APKBUILD b/unmaintained/postgresql-pglogical/APKBUILD new file mode 100644 index 00000000000..00c6571610f --- /dev/null +++ b/unmaintained/postgresql-pglogical/APKBUILD @@ -0,0 +1,29 @@ +# Contributor: Jakub Jirutka +# Contributor: Eugene Pirogov +# Maintainer: Jakub Jirutka +pkgname=postgresql-pglogical +_pkgname=pglogical +pkgver=2.2.1 +pkgrel=0 +pkgdesc="Logical Replication extension for PostgreSQL" +url="https://2ndquadrant.com/en/resources/pglogical/" +arch="all" +license="PostgreSQL" +depends="postgresql" +makedepends="libedit-dev libxml2-dev postgresql-dev zlib-dev" +source="http://packages.2ndquadrant.com/pglogical/tarballs/$_pkgname-$pkgver.tar.bz2 + 001-fix-stdin-handling.patch" +builddir="$srcdir/$_pkgname-$pkgver" + +build() { + cd "$builddir" + make USE_PGXS=1 all +} + +package() { + cd "$builddir" + make USE_PGXS=1 DESTDIR="$pkgdir" install +} + +sha512sums="7526f232e8a69518bb32cba8e9cc06cc18551e9c5747bd73ad443242bb927543faf1c8fc2d70d666aa1059a0b7263d777d4dac0cd708ec98974f0dd0f8d4d1c1 pglogical-2.2.1.tar.bz2 +89df4ed3992f43a0a37eebb5e06dedd2668b6acfad987b3c37e647c05718a9eb0d330d195f4f4426ffc5fad3e1fc7f156c10d3ea6dc7ee778bc2a5b27c6f138f 001-fix-stdin-handling.patch" -- cgit v1.2.3