aboutsummaryrefslogtreecommitdiff
path: root/databases
diff options
context:
space:
mode:
authorJun Kuriyama <kuriyama@FreeBSD.org>2009-03-08 22:59:44 +0000
committerJun Kuriyama <kuriyama@FreeBSD.org>2009-03-08 22:59:44 +0000
commitd5f46201cbe7fad414518fc2c2c7f13135adf68b (patch)
tree7c36f15b34f19e0d996c1b28d4c471802afa6fa5 /databases
parent31d665046cbdac51206b6e7014238756e75074cb (diff)
downloadports-d5f46201cbe7fad414518fc2c2c7f13135adf68b.tar.gz
ports-d5f46201cbe7fad414518fc2c2c7f13135adf68b.zip
- Upgrade to 2.2 (my pcp patches are integrated to this release).
Notes
Notes: svn path=/head/; revision=229699
Diffstat (limited to 'databases')
-rw-r--r--databases/pgpool-II-22/Makefile7
-rw-r--r--databases/pgpool-II-22/distinfo6
-rw-r--r--databases/pgpool-II-22/files/patch-pcp.c598
-rw-r--r--databases/pgpool-II-22/files/patch-pcp.h16
-rw-r--r--databases/pgpool-II-22/files/patch-pcp_attach_node.c112
-rw-r--r--databases/pgpool-II-22/files/patch-pcp_detach_node.c112
-rw-r--r--databases/pgpool-II-22/files/patch-pcp_node_count.c104
-rw-r--r--databases/pgpool-II-22/files/patch-pcp_node_info.c112
-rw-r--r--databases/pgpool-II-22/files/patch-pcp_proc_count.c93
-rw-r--r--databases/pgpool-II-22/files/patch-pcp_proc_info.c112
-rw-r--r--databases/pgpool-II-22/files/patch-pcp_recovery_node.c120
-rw-r--r--databases/pgpool-II-22/files/patch-pcp_stop_pgpool.c119
-rw-r--r--databases/pgpool-II-22/files/patch-pcp_systemdb_info.c109
-rw-r--r--databases/pgpool-II-22/files/patch-pool_sema.c16
-rw-r--r--databases/pgpool-II-23/Makefile7
-rw-r--r--databases/pgpool-II-23/distinfo6
-rw-r--r--databases/pgpool-II-23/files/patch-pcp.c598
-rw-r--r--databases/pgpool-II-23/files/patch-pcp.h16
-rw-r--r--databases/pgpool-II-23/files/patch-pcp_attach_node.c112
-rw-r--r--databases/pgpool-II-23/files/patch-pcp_detach_node.c112
-rw-r--r--databases/pgpool-II-23/files/patch-pcp_node_count.c104
-rw-r--r--databases/pgpool-II-23/files/patch-pcp_node_info.c112
-rw-r--r--databases/pgpool-II-23/files/patch-pcp_proc_count.c93
-rw-r--r--databases/pgpool-II-23/files/patch-pcp_proc_info.c112
-rw-r--r--databases/pgpool-II-23/files/patch-pcp_recovery_node.c120
-rw-r--r--databases/pgpool-II-23/files/patch-pcp_stop_pgpool.c119
-rw-r--r--databases/pgpool-II-23/files/patch-pcp_systemdb_info.c109
-rw-r--r--databases/pgpool-II-23/files/patch-pool_sema.c16
-rw-r--r--databases/pgpool-II-30/Makefile7
-rw-r--r--databases/pgpool-II-30/distinfo6
-rw-r--r--databases/pgpool-II-30/files/patch-pcp.c598
-rw-r--r--databases/pgpool-II-30/files/patch-pcp.h16
-rw-r--r--databases/pgpool-II-30/files/patch-pcp_attach_node.c112
-rw-r--r--databases/pgpool-II-30/files/patch-pcp_detach_node.c112
-rw-r--r--databases/pgpool-II-30/files/patch-pcp_node_count.c104
-rw-r--r--databases/pgpool-II-30/files/patch-pcp_node_info.c112
-rw-r--r--databases/pgpool-II-30/files/patch-pcp_proc_count.c93
-rw-r--r--databases/pgpool-II-30/files/patch-pcp_proc_info.c112
-rw-r--r--databases/pgpool-II-30/files/patch-pcp_recovery_node.c120
-rw-r--r--databases/pgpool-II-30/files/patch-pcp_stop_pgpool.c119
-rw-r--r--databases/pgpool-II-30/files/patch-pcp_systemdb_info.c109
-rw-r--r--databases/pgpool-II-30/files/patch-pool_sema.c16
-rw-r--r--databases/pgpool-II/Makefile7
-rw-r--r--databases/pgpool-II/distinfo6
-rw-r--r--databases/pgpool-II/files/patch-pcp.c598
-rw-r--r--databases/pgpool-II/files/patch-pcp.h16
-rw-r--r--databases/pgpool-II/files/patch-pcp_attach_node.c112
-rw-r--r--databases/pgpool-II/files/patch-pcp_detach_node.c112
-rw-r--r--databases/pgpool-II/files/patch-pcp_node_count.c104
-rw-r--r--databases/pgpool-II/files/patch-pcp_node_info.c112
-rw-r--r--databases/pgpool-II/files/patch-pcp_proc_count.c93
-rw-r--r--databases/pgpool-II/files/patch-pcp_proc_info.c112
-rw-r--r--databases/pgpool-II/files/patch-pcp_recovery_node.c120
-rw-r--r--databases/pgpool-II/files/patch-pcp_stop_pgpool.c119
-rw-r--r--databases/pgpool-II/files/patch-pcp_systemdb_info.c109
-rw-r--r--databases/pgpool-II/files/patch-pool_sema.c16
56 files changed, 28 insertions, 6516 deletions
diff --git a/databases/pgpool-II-22/Makefile b/databases/pgpool-II-22/Makefile
index 8ce0ea60c427..0ca4f35ecdf5 100644
--- a/databases/pgpool-II-22/Makefile
+++ b/databases/pgpool-II-22/Makefile
@@ -6,9 +6,9 @@
#
PORTNAME= pgpool-II
-PORTVERSION= 2.1
+PORTVERSION= 2.2
CATEGORIES= databases
-MASTER_SITES= http://pgfoundry.org/frs/download.php/1843/
+MASTER_SITES= http://pgfoundry.org/frs/download.php/2108/
MAINTAINER= kuriyama@FreeBSD.org
COMMENT= A connection pool server for PostgreSQL
@@ -16,6 +16,7 @@ COMMENT= A connection pool server for PostgreSQL
USE_GMAKE= yes
GNU_CONFIGURE= yes
USE_PGSQL= yes
+USE_LDCONFIG= yes
CONFLICTS= pgpool-3.*
USE_RC_SUBR= pgpool
@@ -40,7 +41,7 @@ pre-install:
${MKDIR} ${DATADIR} ${EXAMPLESDIR}
post-install:
- @cd ${WRKSRC}/sql/pgpool-recovery && ${GMAKE} install
+ @cd ${WRKSRC}/sql/pgpool-recovery && ${GMAKE} ${INSTALL_TARGET}
${INSTALL_DATA} ${WRKSRC}/sample/dist_def_pgbench.sql ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/sample/replicate_def_pgbench.sql ${DATADIR}
.for f in pgpool_recovery pgpool_recovery_pitr pgpool_remote_start
diff --git a/databases/pgpool-II-22/distinfo b/databases/pgpool-II-22/distinfo
index 98942f76876a..9ea234ead9ca 100644
--- a/databases/pgpool-II-22/distinfo
+++ b/databases/pgpool-II-22/distinfo
@@ -1,3 +1,3 @@
-MD5 (pgpool-II-2.1.tar.gz) = cf02f9358f46849bd526798868e13162
-SHA256 (pgpool-II-2.1.tar.gz) = 8834b6ca01eab57d2c947c1016f164e0538e45242f1d3a3fa99932dae87ba890
-SIZE (pgpool-II-2.1.tar.gz) = 932731
+MD5 (pgpool-II-2.2.tar.gz) = 3dc286e2217478acbc05f127e74bd300
+SHA256 (pgpool-II-2.2.tar.gz) = 2a404dd3965c5d869c17ab0c031395a43445d6fcf0c72df8bd78d9629b8ed25b
+SIZE (pgpool-II-2.2.tar.gz) = 961675
diff --git a/databases/pgpool-II-22/files/patch-pcp.c b/databases/pgpool-II-22/files/patch-pcp.c
deleted file mode 100644
index 72eb5d9632ec..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp.c
+++ /dev/null
@@ -1,598 +0,0 @@
-Index: pcp/pcp.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp.c,v
-retrieving revision 1.7
-diff -u -r1.7 pcp.c
---- pcp/pcp.c 8 Feb 2008 08:10:43 -0000 1.7
-+++ pcp/pcp.c 29 Dec 2008 05:15:44 -0000
-@@ -42,6 +42,11 @@
- struct timeval pcp_timeout;
-
- static PCP_CONNECTION *pc;
-+#ifdef DEBUG
-+static int debug = 1;
-+#else
-+static int debug = 0;
-+#endif
- static int pcp_authorize(char *username, char *password);
-
- /* --------------------------------
-@@ -62,9 +67,7 @@
-
- if (pc != NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection to backend \"%s\" already exists\n", hostname);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection to backend \"%s\" already exists\n", hostname);
- return 0;
- }
-
-@@ -76,9 +79,7 @@
-
- if (fd < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not create socket\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not create socket\n");
- errorcode = SOCKERR;
- return -1;
- }
-@@ -100,9 +101,7 @@
-
- if (connect(fd, (struct sockaddr *) &unix_addr, sizeof(unix_addr)) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", unix_addr.sun_path);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", unix_addr.sun_path);
- close(fd);
- errorcode = CONNERR;
- return -1;
-@@ -113,9 +112,7 @@
- fd = socket(AF_INET, SOCK_STREAM, 0);
- if (fd < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not create socket\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not create socket\n");
- errorcode = SOCKERR;
- return -1;
- }
-@@ -123,9 +120,7 @@
- if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
- (char *) &on, sizeof(on)) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not set socket option\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not set socket option\n");
- close(fd);
- errorcode = SOCKERR;
- return -1;
-@@ -136,9 +131,7 @@
- hp = gethostbyname(hostname);
- if ((hp == NULL) || (hp->h_addrtype != AF_INET))
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not retrieve hostname\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not retrieve hostname\n");
- close(fd);
- errorcode = HOSTERR;
- return -1;
-@@ -151,9 +144,7 @@
- len = sizeof(struct sockaddr_in);
- if (connect(fd, (struct sockaddr *) &addr, len) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", hostname);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", hostname);
- close(fd);
- errorcode = CONNERR;
- return -1;
-@@ -163,9 +154,7 @@
- pc = pcp_open(fd);
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not allocate buffer space\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not allocate buffer space\n");
- close(fd);
- return -1;
- }
-@@ -202,9 +191,7 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
-
-@@ -243,14 +230,10 @@
- pcp_write(pc, encrypt_buf, strlen(encrypt_buf)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"R\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"R\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -265,15 +248,11 @@
- }
- if (pcp_read(pc, buf, rsize - sizeof(int)))
- return -1;
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'r')
-@@ -284,9 +263,7 @@
- return 0;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: authentication failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: authentication failed. reason=%s\n", buf);
- errorcode = AUTHERR;
- }
- free(buf);
-@@ -305,9 +282,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- return;
- }
-
-@@ -318,9 +293,7 @@
- {
- /* backend had closed connection already */
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"X\", len=%d\n", sizeof(int));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"X\", len=%d\n", sizeof(int));
-
- pcp_close(pc);
- pc = NULL;
-@@ -339,9 +312,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -352,14 +323,10 @@
- pcp_write(pc, &mode, sizeof(char));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"T\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"T\", len=%d\n", ntohl(wsize));
-
- return 0;
- }
-@@ -381,9 +348,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -393,14 +358,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"L\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"L\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -419,15 +380,11 @@
- return -1;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'l')
-@@ -466,9 +423,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -481,14 +436,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"I\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"I\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return NULL;
-@@ -507,15 +458,11 @@
- return NULL;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- free(buf);
- return NULL;
-@@ -578,9 +525,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -590,14 +535,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"N\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"N\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return NULL;
-@@ -615,15 +556,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -685,9 +622,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -700,14 +635,10 @@
- pcp_write(pc, process_id, strlen(process_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"P\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"P\", len=%d\n", ntohl(wsize));
-
- while (1)
- {
-@@ -727,15 +658,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -836,9 +763,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -848,14 +773,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"S\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"S\", len=%d\n", ntohl(wsize));
-
- while (1) {
- if (pcp_read(pc, &tos, 1))
-@@ -874,15 +795,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -1166,9 +1083,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1181,14 +1096,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1206,15 +1117,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'd')
-@@ -1249,9 +1156,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1264,14 +1169,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1289,15 +1190,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'c')
-@@ -1334,9 +1231,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1349,14 +1244,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1374,15 +1265,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'c')
-@@ -1398,3 +1285,15 @@
- free(buf);
- return -1;
- }
-+
-+void
-+pcp_enable_debug(void)
-+{
-+ debug = 1;
-+}
-+
-+void
-+pcp_disable_debug(void)
-+{
-+ debug = 0;
-+}
diff --git a/databases/pgpool-II-22/files/patch-pcp.h b/databases/pgpool-II-22/files/patch-pcp.h
deleted file mode 100644
index bcf3b0e69e27..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: pcp/pcp.h
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp.h,v
-retrieving revision 1.3
-diff -u -r1.3 pcp.h
---- pcp/pcp.h 29 Jan 2008 01:56:37 -0000 1.3
-+++ pcp/pcp.h 29 Dec 2008 05:15:44 -0000
-@@ -62,6 +62,8 @@
- extern int pcp_attach_node(int nid);
- extern void pcp_set_timeout(long sec);
- extern int pcp_recovery_node(int nid);
-+extern void pcp_enable_debug(void);
-+extern void pcp_disable_debug(void);
-
- /* ------------------------------
- * pcp_error.c
diff --git a/databases/pgpool-II-22/files/patch-pcp_attach_node.c b/databases/pgpool-II-22/files/patch-pcp_attach_node.c
deleted file mode 100644
index 6453f9f244be..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp_attach_node.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_attach_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_attach_node.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_attach_node.c
---- pcp/pcp_attach_node.c 29 Jan 2008 01:56:37 -0000 1.2
-+++ pcp/pcp_attach_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,23 +87,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_attach_node - attach a node from pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_attach_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_attach_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_attach_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-22/files/patch-pcp_detach_node.c b/databases/pgpool-II-22/files/patch-pcp_detach_node.c
deleted file mode 100644
index df68f227e370..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp_detach_node.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_detach_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_detach_node.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_detach_node.c
---- pcp/pcp_detach_node.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_detach_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,23 +87,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_detach_node - detach a node from pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_detach_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_detach_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_detach_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-22/files/patch-pcp_node_count.c b/databases/pgpool-II-22/files/patch-pcp_node_count.c
deleted file mode 100644
index 295868a121dd..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp_node_count.c
+++ /dev/null
@@ -1,104 +0,0 @@
-Index: pcp/pcp_node_count.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_node_count.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_node_count.c
---- pcp/pcp_node_count.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_node_count.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,53 +39,64 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int node_count;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6) {
-+ if (argc != 5) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN) {
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- pcp_set_timeout(timeout);
-
-@@ -112,8 +124,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_node_count - display the total number of nodes under pgpool-II's control\n\n");
-- fprintf(stderr, "Usage: pcp_node_count timeout hostname port# username password\n");
-+ fprintf(stderr, "Usage: pcp_node_count [-d] timeout hostname port# username password\n");
- fprintf(stderr, "Usage: pcp_node_count -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-22/files/patch-pcp_node_info.c b/databases/pgpool-II-22/files/patch-pcp_node_info.c
deleted file mode 100644
index ae9cb9b33f62..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp_node_info.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_node_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_node_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_node_info.c
---- pcp/pcp_node_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_node_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,36 +40,47 @@
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
- BackendInfo *backend_info;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -76,23 +88,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -132,8 +144,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_node_info - display a pgpool-II node's information\n\n");
-- fprintf(stderr, "Usage: pcp_node_info timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_node_info [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_node_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-22/files/patch-pcp_proc_count.c b/databases/pgpool-II-22/files/patch-pcp_proc_count.c
deleted file mode 100644
index 326522770ea0..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp_proc_count.c
+++ /dev/null
@@ -1,93 +0,0 @@
-Index: pcp/pcp_proc_count.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_proc_count.c,v
-retrieving revision 1.3
-diff -u -r1.3 pcp_proc_count.c
---- pcp/pcp_proc_count.c 29 Jan 2008 01:56:38 -0000 1.3
-+++ pcp/pcp_proc_count.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,53 +40,64 @@
- char pass[MAX_USER_PASSWD_LEN];
- int process_count;
- int *process_list = NULL;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6) {
-+ if (argc != 5) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN) {
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- pcp_set_timeout(timeout);
-
diff --git a/databases/pgpool-II-22/files/patch-pcp_proc_info.c b/databases/pgpool-II-22/files/patch-pcp_proc_info.c
deleted file mode 100644
index a573ff5c26ef..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp_proc_info.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_proc_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_proc_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_proc_info.c
---- pcp/pcp_proc_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_proc_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -40,36 +41,47 @@
- int processID;
- ProcessInfo *process_info;
- int array_size;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -77,23 +89,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- processID = atoi(argv[6]);
-+ processID = atoi(argv[5]);
- if (processID < 0)
- {
- errorcode = INVALERR;
-@@ -142,8 +154,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_proc_info - display a pgpool-II child process' information\n\n");
-- fprintf(stderr, "Usage: pcp_proc_info timeout hostname port# username password PID\n");
-+ fprintf(stderr, "Usage: pcp_proc_info [-d] timeout hostname port# username password PID\n");
- fprintf(stderr, "Usage: pcp_proc_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-22/files/patch-pcp_recovery_node.c b/databases/pgpool-II-22/files/patch-pcp_recovery_node.c
deleted file mode 100644
index c44445836a47..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp_recovery_node.c
+++ /dev/null
@@ -1,120 +0,0 @@
-Index: pcp/pcp_recovery_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_recovery_node.c,v
-retrieving revision 1.3
-diff -u -r1.3 pcp_recovery_node.c
---- pcp/pcp_recovery_node.c 12 Mar 2008 04:53:51 -0000 1.3
-+++ pcp/pcp_recovery_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,30 +87,30 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
--
-+
- pcp_set_timeout(timeout);
-
- if (pcp_connect(host, port, user, pass))
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_recovery_node - recovery a node\n\n");
-- fprintf(stderr, "Usage: pcp_recovery_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_recovery_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_recovery_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-22/files/patch-pcp_stop_pgpool.c b/databases/pgpool-II-22/files/patch-pcp_stop_pgpool.c
deleted file mode 100644
index 4730c6aeea60..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp_stop_pgpool.c
+++ /dev/null
@@ -1,119 +0,0 @@
-Index: pcp/pcp_stop_pgpool.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_stop_pgpool.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_stop_pgpool.c
---- pcp/pcp_stop_pgpool.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_stop_pgpool.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- char mode;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,29 +87,29 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- if (strlen(argv[6]) != 1)
-+ if (strlen(argv[5]) != 1)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- mode = argv[6][0];
-+ mode = argv[5][0];
- if (mode != 's' && mode != 'f' && mode != 'i')
- {
- errorcode = INVALERR;
-@@ -131,8 +143,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_stop_pgpool - terminate pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_stop_pgpool timeout hostname port# username password mode\n");
-+ fprintf(stderr, "Usage: pcp_stop_pgpool [-d] timeout hostname port# username password mode\n");
- fprintf(stderr, "Usage: pcp_stop_pgpool -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-22/files/patch-pcp_systemdb_info.c b/databases/pgpool-II-22/files/patch-pcp_systemdb_info.c
deleted file mode 100644
index 4cd3094b4288..000000000000
--- a/databases/pgpool-II-22/files/patch-pcp_systemdb_info.c
+++ /dev/null
@@ -1,109 +0,0 @@
-Index: pcp/pcp_systemdb_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_systemdb_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_systemdb_info.c
---- pcp/pcp_systemdb_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_systemdb_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,36 +40,47 @@
- char pass[MAX_USER_PASSWD_LEN];
- SystemDBInfo *systemdb_info;
- int i, j;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6)
-+ if (argc != 5)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -76,21 +88,21 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- if (pcp_connect(host, port, user, pass))
- {
-@@ -146,8 +158,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_systemdb_info - display the pgpool-II systemDB information\n\n");
-- fprintf(stderr, "Usage: pcp_systemdb_info timeout hostname port# username password\n");
-+ fprintf(stderr, "Usage: pcp_systemdb_info [-d] timeout hostname port# username password\n");
- fprintf(stderr, "Usage: pcp_systemdb_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-22/files/patch-pool_sema.c b/databases/pgpool-II-22/files/patch-pool_sema.c
deleted file mode 100644
index a2faf136dc70..000000000000
--- a/databases/pgpool-II-22/files/patch-pool_sema.c
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: pool_sema.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pool_sema.c,v
-retrieving revision 1.4
-diff -u -r1.4 pool_sema.c
---- pool_sema.c 29 Jan 2008 01:56:36 -0000 1.4
-+++ pool_sema.c 29 Dec 2008 05:15:44 -0000
-@@ -82,7 +82,7 @@
-
- if (semId < 0)
- {
-- pool_error("could not create semaphores: %s", strerror(errno));
-+ pool_error("could not create %d semaphores: %s", numSems, strerror(errno));
- return -1;
- }
-
diff --git a/databases/pgpool-II-23/Makefile b/databases/pgpool-II-23/Makefile
index 8ce0ea60c427..0ca4f35ecdf5 100644
--- a/databases/pgpool-II-23/Makefile
+++ b/databases/pgpool-II-23/Makefile
@@ -6,9 +6,9 @@
#
PORTNAME= pgpool-II
-PORTVERSION= 2.1
+PORTVERSION= 2.2
CATEGORIES= databases
-MASTER_SITES= http://pgfoundry.org/frs/download.php/1843/
+MASTER_SITES= http://pgfoundry.org/frs/download.php/2108/
MAINTAINER= kuriyama@FreeBSD.org
COMMENT= A connection pool server for PostgreSQL
@@ -16,6 +16,7 @@ COMMENT= A connection pool server for PostgreSQL
USE_GMAKE= yes
GNU_CONFIGURE= yes
USE_PGSQL= yes
+USE_LDCONFIG= yes
CONFLICTS= pgpool-3.*
USE_RC_SUBR= pgpool
@@ -40,7 +41,7 @@ pre-install:
${MKDIR} ${DATADIR} ${EXAMPLESDIR}
post-install:
- @cd ${WRKSRC}/sql/pgpool-recovery && ${GMAKE} install
+ @cd ${WRKSRC}/sql/pgpool-recovery && ${GMAKE} ${INSTALL_TARGET}
${INSTALL_DATA} ${WRKSRC}/sample/dist_def_pgbench.sql ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/sample/replicate_def_pgbench.sql ${DATADIR}
.for f in pgpool_recovery pgpool_recovery_pitr pgpool_remote_start
diff --git a/databases/pgpool-II-23/distinfo b/databases/pgpool-II-23/distinfo
index 98942f76876a..9ea234ead9ca 100644
--- a/databases/pgpool-II-23/distinfo
+++ b/databases/pgpool-II-23/distinfo
@@ -1,3 +1,3 @@
-MD5 (pgpool-II-2.1.tar.gz) = cf02f9358f46849bd526798868e13162
-SHA256 (pgpool-II-2.1.tar.gz) = 8834b6ca01eab57d2c947c1016f164e0538e45242f1d3a3fa99932dae87ba890
-SIZE (pgpool-II-2.1.tar.gz) = 932731
+MD5 (pgpool-II-2.2.tar.gz) = 3dc286e2217478acbc05f127e74bd300
+SHA256 (pgpool-II-2.2.tar.gz) = 2a404dd3965c5d869c17ab0c031395a43445d6fcf0c72df8bd78d9629b8ed25b
+SIZE (pgpool-II-2.2.tar.gz) = 961675
diff --git a/databases/pgpool-II-23/files/patch-pcp.c b/databases/pgpool-II-23/files/patch-pcp.c
deleted file mode 100644
index 72eb5d9632ec..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp.c
+++ /dev/null
@@ -1,598 +0,0 @@
-Index: pcp/pcp.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp.c,v
-retrieving revision 1.7
-diff -u -r1.7 pcp.c
---- pcp/pcp.c 8 Feb 2008 08:10:43 -0000 1.7
-+++ pcp/pcp.c 29 Dec 2008 05:15:44 -0000
-@@ -42,6 +42,11 @@
- struct timeval pcp_timeout;
-
- static PCP_CONNECTION *pc;
-+#ifdef DEBUG
-+static int debug = 1;
-+#else
-+static int debug = 0;
-+#endif
- static int pcp_authorize(char *username, char *password);
-
- /* --------------------------------
-@@ -62,9 +67,7 @@
-
- if (pc != NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection to backend \"%s\" already exists\n", hostname);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection to backend \"%s\" already exists\n", hostname);
- return 0;
- }
-
-@@ -76,9 +79,7 @@
-
- if (fd < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not create socket\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not create socket\n");
- errorcode = SOCKERR;
- return -1;
- }
-@@ -100,9 +101,7 @@
-
- if (connect(fd, (struct sockaddr *) &unix_addr, sizeof(unix_addr)) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", unix_addr.sun_path);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", unix_addr.sun_path);
- close(fd);
- errorcode = CONNERR;
- return -1;
-@@ -113,9 +112,7 @@
- fd = socket(AF_INET, SOCK_STREAM, 0);
- if (fd < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not create socket\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not create socket\n");
- errorcode = SOCKERR;
- return -1;
- }
-@@ -123,9 +120,7 @@
- if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
- (char *) &on, sizeof(on)) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not set socket option\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not set socket option\n");
- close(fd);
- errorcode = SOCKERR;
- return -1;
-@@ -136,9 +131,7 @@
- hp = gethostbyname(hostname);
- if ((hp == NULL) || (hp->h_addrtype != AF_INET))
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not retrieve hostname\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not retrieve hostname\n");
- close(fd);
- errorcode = HOSTERR;
- return -1;
-@@ -151,9 +144,7 @@
- len = sizeof(struct sockaddr_in);
- if (connect(fd, (struct sockaddr *) &addr, len) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", hostname);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", hostname);
- close(fd);
- errorcode = CONNERR;
- return -1;
-@@ -163,9 +154,7 @@
- pc = pcp_open(fd);
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not allocate buffer space\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not allocate buffer space\n");
- close(fd);
- return -1;
- }
-@@ -202,9 +191,7 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
-
-@@ -243,14 +230,10 @@
- pcp_write(pc, encrypt_buf, strlen(encrypt_buf)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"R\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"R\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -265,15 +248,11 @@
- }
- if (pcp_read(pc, buf, rsize - sizeof(int)))
- return -1;
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'r')
-@@ -284,9 +263,7 @@
- return 0;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: authentication failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: authentication failed. reason=%s\n", buf);
- errorcode = AUTHERR;
- }
- free(buf);
-@@ -305,9 +282,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- return;
- }
-
-@@ -318,9 +293,7 @@
- {
- /* backend had closed connection already */
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"X\", len=%d\n", sizeof(int));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"X\", len=%d\n", sizeof(int));
-
- pcp_close(pc);
- pc = NULL;
-@@ -339,9 +312,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -352,14 +323,10 @@
- pcp_write(pc, &mode, sizeof(char));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"T\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"T\", len=%d\n", ntohl(wsize));
-
- return 0;
- }
-@@ -381,9 +348,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -393,14 +358,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"L\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"L\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -419,15 +380,11 @@
- return -1;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'l')
-@@ -466,9 +423,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -481,14 +436,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"I\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"I\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return NULL;
-@@ -507,15 +458,11 @@
- return NULL;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- free(buf);
- return NULL;
-@@ -578,9 +525,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -590,14 +535,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"N\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"N\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return NULL;
-@@ -615,15 +556,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -685,9 +622,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -700,14 +635,10 @@
- pcp_write(pc, process_id, strlen(process_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"P\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"P\", len=%d\n", ntohl(wsize));
-
- while (1)
- {
-@@ -727,15 +658,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -836,9 +763,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -848,14 +773,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"S\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"S\", len=%d\n", ntohl(wsize));
-
- while (1) {
- if (pcp_read(pc, &tos, 1))
-@@ -874,15 +795,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -1166,9 +1083,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1181,14 +1096,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1206,15 +1117,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'd')
-@@ -1249,9 +1156,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1264,14 +1169,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1289,15 +1190,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'c')
-@@ -1334,9 +1231,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1349,14 +1244,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1374,15 +1265,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'c')
-@@ -1398,3 +1285,15 @@
- free(buf);
- return -1;
- }
-+
-+void
-+pcp_enable_debug(void)
-+{
-+ debug = 1;
-+}
-+
-+void
-+pcp_disable_debug(void)
-+{
-+ debug = 0;
-+}
diff --git a/databases/pgpool-II-23/files/patch-pcp.h b/databases/pgpool-II-23/files/patch-pcp.h
deleted file mode 100644
index bcf3b0e69e27..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: pcp/pcp.h
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp.h,v
-retrieving revision 1.3
-diff -u -r1.3 pcp.h
---- pcp/pcp.h 29 Jan 2008 01:56:37 -0000 1.3
-+++ pcp/pcp.h 29 Dec 2008 05:15:44 -0000
-@@ -62,6 +62,8 @@
- extern int pcp_attach_node(int nid);
- extern void pcp_set_timeout(long sec);
- extern int pcp_recovery_node(int nid);
-+extern void pcp_enable_debug(void);
-+extern void pcp_disable_debug(void);
-
- /* ------------------------------
- * pcp_error.c
diff --git a/databases/pgpool-II-23/files/patch-pcp_attach_node.c b/databases/pgpool-II-23/files/patch-pcp_attach_node.c
deleted file mode 100644
index 6453f9f244be..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp_attach_node.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_attach_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_attach_node.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_attach_node.c
---- pcp/pcp_attach_node.c 29 Jan 2008 01:56:37 -0000 1.2
-+++ pcp/pcp_attach_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,23 +87,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_attach_node - attach a node from pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_attach_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_attach_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_attach_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-23/files/patch-pcp_detach_node.c b/databases/pgpool-II-23/files/patch-pcp_detach_node.c
deleted file mode 100644
index df68f227e370..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp_detach_node.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_detach_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_detach_node.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_detach_node.c
---- pcp/pcp_detach_node.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_detach_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,23 +87,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_detach_node - detach a node from pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_detach_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_detach_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_detach_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-23/files/patch-pcp_node_count.c b/databases/pgpool-II-23/files/patch-pcp_node_count.c
deleted file mode 100644
index 295868a121dd..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp_node_count.c
+++ /dev/null
@@ -1,104 +0,0 @@
-Index: pcp/pcp_node_count.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_node_count.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_node_count.c
---- pcp/pcp_node_count.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_node_count.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,53 +39,64 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int node_count;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6) {
-+ if (argc != 5) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN) {
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- pcp_set_timeout(timeout);
-
-@@ -112,8 +124,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_node_count - display the total number of nodes under pgpool-II's control\n\n");
-- fprintf(stderr, "Usage: pcp_node_count timeout hostname port# username password\n");
-+ fprintf(stderr, "Usage: pcp_node_count [-d] timeout hostname port# username password\n");
- fprintf(stderr, "Usage: pcp_node_count -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-23/files/patch-pcp_node_info.c b/databases/pgpool-II-23/files/patch-pcp_node_info.c
deleted file mode 100644
index ae9cb9b33f62..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp_node_info.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_node_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_node_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_node_info.c
---- pcp/pcp_node_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_node_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,36 +40,47 @@
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
- BackendInfo *backend_info;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -76,23 +88,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -132,8 +144,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_node_info - display a pgpool-II node's information\n\n");
-- fprintf(stderr, "Usage: pcp_node_info timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_node_info [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_node_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-23/files/patch-pcp_proc_count.c b/databases/pgpool-II-23/files/patch-pcp_proc_count.c
deleted file mode 100644
index 326522770ea0..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp_proc_count.c
+++ /dev/null
@@ -1,93 +0,0 @@
-Index: pcp/pcp_proc_count.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_proc_count.c,v
-retrieving revision 1.3
-diff -u -r1.3 pcp_proc_count.c
---- pcp/pcp_proc_count.c 29 Jan 2008 01:56:38 -0000 1.3
-+++ pcp/pcp_proc_count.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,53 +40,64 @@
- char pass[MAX_USER_PASSWD_LEN];
- int process_count;
- int *process_list = NULL;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6) {
-+ if (argc != 5) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN) {
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- pcp_set_timeout(timeout);
-
diff --git a/databases/pgpool-II-23/files/patch-pcp_proc_info.c b/databases/pgpool-II-23/files/patch-pcp_proc_info.c
deleted file mode 100644
index a573ff5c26ef..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp_proc_info.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_proc_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_proc_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_proc_info.c
---- pcp/pcp_proc_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_proc_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -40,36 +41,47 @@
- int processID;
- ProcessInfo *process_info;
- int array_size;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -77,23 +89,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- processID = atoi(argv[6]);
-+ processID = atoi(argv[5]);
- if (processID < 0)
- {
- errorcode = INVALERR;
-@@ -142,8 +154,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_proc_info - display a pgpool-II child process' information\n\n");
-- fprintf(stderr, "Usage: pcp_proc_info timeout hostname port# username password PID\n");
-+ fprintf(stderr, "Usage: pcp_proc_info [-d] timeout hostname port# username password PID\n");
- fprintf(stderr, "Usage: pcp_proc_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-23/files/patch-pcp_recovery_node.c b/databases/pgpool-II-23/files/patch-pcp_recovery_node.c
deleted file mode 100644
index c44445836a47..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp_recovery_node.c
+++ /dev/null
@@ -1,120 +0,0 @@
-Index: pcp/pcp_recovery_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_recovery_node.c,v
-retrieving revision 1.3
-diff -u -r1.3 pcp_recovery_node.c
---- pcp/pcp_recovery_node.c 12 Mar 2008 04:53:51 -0000 1.3
-+++ pcp/pcp_recovery_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,30 +87,30 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
--
-+
- pcp_set_timeout(timeout);
-
- if (pcp_connect(host, port, user, pass))
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_recovery_node - recovery a node\n\n");
-- fprintf(stderr, "Usage: pcp_recovery_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_recovery_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_recovery_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-23/files/patch-pcp_stop_pgpool.c b/databases/pgpool-II-23/files/patch-pcp_stop_pgpool.c
deleted file mode 100644
index 4730c6aeea60..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp_stop_pgpool.c
+++ /dev/null
@@ -1,119 +0,0 @@
-Index: pcp/pcp_stop_pgpool.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_stop_pgpool.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_stop_pgpool.c
---- pcp/pcp_stop_pgpool.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_stop_pgpool.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- char mode;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,29 +87,29 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- if (strlen(argv[6]) != 1)
-+ if (strlen(argv[5]) != 1)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- mode = argv[6][0];
-+ mode = argv[5][0];
- if (mode != 's' && mode != 'f' && mode != 'i')
- {
- errorcode = INVALERR;
-@@ -131,8 +143,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_stop_pgpool - terminate pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_stop_pgpool timeout hostname port# username password mode\n");
-+ fprintf(stderr, "Usage: pcp_stop_pgpool [-d] timeout hostname port# username password mode\n");
- fprintf(stderr, "Usage: pcp_stop_pgpool -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-23/files/patch-pcp_systemdb_info.c b/databases/pgpool-II-23/files/patch-pcp_systemdb_info.c
deleted file mode 100644
index 4cd3094b4288..000000000000
--- a/databases/pgpool-II-23/files/patch-pcp_systemdb_info.c
+++ /dev/null
@@ -1,109 +0,0 @@
-Index: pcp/pcp_systemdb_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_systemdb_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_systemdb_info.c
---- pcp/pcp_systemdb_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_systemdb_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,36 +40,47 @@
- char pass[MAX_USER_PASSWD_LEN];
- SystemDBInfo *systemdb_info;
- int i, j;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6)
-+ if (argc != 5)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -76,21 +88,21 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- if (pcp_connect(host, port, user, pass))
- {
-@@ -146,8 +158,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_systemdb_info - display the pgpool-II systemDB information\n\n");
-- fprintf(stderr, "Usage: pcp_systemdb_info timeout hostname port# username password\n");
-+ fprintf(stderr, "Usage: pcp_systemdb_info [-d] timeout hostname port# username password\n");
- fprintf(stderr, "Usage: pcp_systemdb_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-23/files/patch-pool_sema.c b/databases/pgpool-II-23/files/patch-pool_sema.c
deleted file mode 100644
index a2faf136dc70..000000000000
--- a/databases/pgpool-II-23/files/patch-pool_sema.c
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: pool_sema.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pool_sema.c,v
-retrieving revision 1.4
-diff -u -r1.4 pool_sema.c
---- pool_sema.c 29 Jan 2008 01:56:36 -0000 1.4
-+++ pool_sema.c 29 Dec 2008 05:15:44 -0000
-@@ -82,7 +82,7 @@
-
- if (semId < 0)
- {
-- pool_error("could not create semaphores: %s", strerror(errno));
-+ pool_error("could not create %d semaphores: %s", numSems, strerror(errno));
- return -1;
- }
-
diff --git a/databases/pgpool-II-30/Makefile b/databases/pgpool-II-30/Makefile
index 8ce0ea60c427..0ca4f35ecdf5 100644
--- a/databases/pgpool-II-30/Makefile
+++ b/databases/pgpool-II-30/Makefile
@@ -6,9 +6,9 @@
#
PORTNAME= pgpool-II
-PORTVERSION= 2.1
+PORTVERSION= 2.2
CATEGORIES= databases
-MASTER_SITES= http://pgfoundry.org/frs/download.php/1843/
+MASTER_SITES= http://pgfoundry.org/frs/download.php/2108/
MAINTAINER= kuriyama@FreeBSD.org
COMMENT= A connection pool server for PostgreSQL
@@ -16,6 +16,7 @@ COMMENT= A connection pool server for PostgreSQL
USE_GMAKE= yes
GNU_CONFIGURE= yes
USE_PGSQL= yes
+USE_LDCONFIG= yes
CONFLICTS= pgpool-3.*
USE_RC_SUBR= pgpool
@@ -40,7 +41,7 @@ pre-install:
${MKDIR} ${DATADIR} ${EXAMPLESDIR}
post-install:
- @cd ${WRKSRC}/sql/pgpool-recovery && ${GMAKE} install
+ @cd ${WRKSRC}/sql/pgpool-recovery && ${GMAKE} ${INSTALL_TARGET}
${INSTALL_DATA} ${WRKSRC}/sample/dist_def_pgbench.sql ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/sample/replicate_def_pgbench.sql ${DATADIR}
.for f in pgpool_recovery pgpool_recovery_pitr pgpool_remote_start
diff --git a/databases/pgpool-II-30/distinfo b/databases/pgpool-II-30/distinfo
index 98942f76876a..9ea234ead9ca 100644
--- a/databases/pgpool-II-30/distinfo
+++ b/databases/pgpool-II-30/distinfo
@@ -1,3 +1,3 @@
-MD5 (pgpool-II-2.1.tar.gz) = cf02f9358f46849bd526798868e13162
-SHA256 (pgpool-II-2.1.tar.gz) = 8834b6ca01eab57d2c947c1016f164e0538e45242f1d3a3fa99932dae87ba890
-SIZE (pgpool-II-2.1.tar.gz) = 932731
+MD5 (pgpool-II-2.2.tar.gz) = 3dc286e2217478acbc05f127e74bd300
+SHA256 (pgpool-II-2.2.tar.gz) = 2a404dd3965c5d869c17ab0c031395a43445d6fcf0c72df8bd78d9629b8ed25b
+SIZE (pgpool-II-2.2.tar.gz) = 961675
diff --git a/databases/pgpool-II-30/files/patch-pcp.c b/databases/pgpool-II-30/files/patch-pcp.c
deleted file mode 100644
index 72eb5d9632ec..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp.c
+++ /dev/null
@@ -1,598 +0,0 @@
-Index: pcp/pcp.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp.c,v
-retrieving revision 1.7
-diff -u -r1.7 pcp.c
---- pcp/pcp.c 8 Feb 2008 08:10:43 -0000 1.7
-+++ pcp/pcp.c 29 Dec 2008 05:15:44 -0000
-@@ -42,6 +42,11 @@
- struct timeval pcp_timeout;
-
- static PCP_CONNECTION *pc;
-+#ifdef DEBUG
-+static int debug = 1;
-+#else
-+static int debug = 0;
-+#endif
- static int pcp_authorize(char *username, char *password);
-
- /* --------------------------------
-@@ -62,9 +67,7 @@
-
- if (pc != NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection to backend \"%s\" already exists\n", hostname);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection to backend \"%s\" already exists\n", hostname);
- return 0;
- }
-
-@@ -76,9 +79,7 @@
-
- if (fd < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not create socket\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not create socket\n");
- errorcode = SOCKERR;
- return -1;
- }
-@@ -100,9 +101,7 @@
-
- if (connect(fd, (struct sockaddr *) &unix_addr, sizeof(unix_addr)) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", unix_addr.sun_path);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", unix_addr.sun_path);
- close(fd);
- errorcode = CONNERR;
- return -1;
-@@ -113,9 +112,7 @@
- fd = socket(AF_INET, SOCK_STREAM, 0);
- if (fd < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not create socket\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not create socket\n");
- errorcode = SOCKERR;
- return -1;
- }
-@@ -123,9 +120,7 @@
- if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
- (char *) &on, sizeof(on)) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not set socket option\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not set socket option\n");
- close(fd);
- errorcode = SOCKERR;
- return -1;
-@@ -136,9 +131,7 @@
- hp = gethostbyname(hostname);
- if ((hp == NULL) || (hp->h_addrtype != AF_INET))
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not retrieve hostname\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not retrieve hostname\n");
- close(fd);
- errorcode = HOSTERR;
- return -1;
-@@ -151,9 +144,7 @@
- len = sizeof(struct sockaddr_in);
- if (connect(fd, (struct sockaddr *) &addr, len) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", hostname);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", hostname);
- close(fd);
- errorcode = CONNERR;
- return -1;
-@@ -163,9 +154,7 @@
- pc = pcp_open(fd);
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not allocate buffer space\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not allocate buffer space\n");
- close(fd);
- return -1;
- }
-@@ -202,9 +191,7 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
-
-@@ -243,14 +230,10 @@
- pcp_write(pc, encrypt_buf, strlen(encrypt_buf)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"R\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"R\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -265,15 +248,11 @@
- }
- if (pcp_read(pc, buf, rsize - sizeof(int)))
- return -1;
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'r')
-@@ -284,9 +263,7 @@
- return 0;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: authentication failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: authentication failed. reason=%s\n", buf);
- errorcode = AUTHERR;
- }
- free(buf);
-@@ -305,9 +282,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- return;
- }
-
-@@ -318,9 +293,7 @@
- {
- /* backend had closed connection already */
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"X\", len=%d\n", sizeof(int));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"X\", len=%d\n", sizeof(int));
-
- pcp_close(pc);
- pc = NULL;
-@@ -339,9 +312,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -352,14 +323,10 @@
- pcp_write(pc, &mode, sizeof(char));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"T\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"T\", len=%d\n", ntohl(wsize));
-
- return 0;
- }
-@@ -381,9 +348,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -393,14 +358,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"L\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"L\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -419,15 +380,11 @@
- return -1;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'l')
-@@ -466,9 +423,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -481,14 +436,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"I\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"I\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return NULL;
-@@ -507,15 +458,11 @@
- return NULL;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- free(buf);
- return NULL;
-@@ -578,9 +525,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -590,14 +535,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"N\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"N\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return NULL;
-@@ -615,15 +556,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -685,9 +622,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -700,14 +635,10 @@
- pcp_write(pc, process_id, strlen(process_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"P\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"P\", len=%d\n", ntohl(wsize));
-
- while (1)
- {
-@@ -727,15 +658,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -836,9 +763,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -848,14 +773,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"S\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"S\", len=%d\n", ntohl(wsize));
-
- while (1) {
- if (pcp_read(pc, &tos, 1))
-@@ -874,15 +795,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -1166,9 +1083,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1181,14 +1096,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1206,15 +1117,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'd')
-@@ -1249,9 +1156,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1264,14 +1169,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1289,15 +1190,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'c')
-@@ -1334,9 +1231,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1349,14 +1244,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1374,15 +1265,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'c')
-@@ -1398,3 +1285,15 @@
- free(buf);
- return -1;
- }
-+
-+void
-+pcp_enable_debug(void)
-+{
-+ debug = 1;
-+}
-+
-+void
-+pcp_disable_debug(void)
-+{
-+ debug = 0;
-+}
diff --git a/databases/pgpool-II-30/files/patch-pcp.h b/databases/pgpool-II-30/files/patch-pcp.h
deleted file mode 100644
index bcf3b0e69e27..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: pcp/pcp.h
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp.h,v
-retrieving revision 1.3
-diff -u -r1.3 pcp.h
---- pcp/pcp.h 29 Jan 2008 01:56:37 -0000 1.3
-+++ pcp/pcp.h 29 Dec 2008 05:15:44 -0000
-@@ -62,6 +62,8 @@
- extern int pcp_attach_node(int nid);
- extern void pcp_set_timeout(long sec);
- extern int pcp_recovery_node(int nid);
-+extern void pcp_enable_debug(void);
-+extern void pcp_disable_debug(void);
-
- /* ------------------------------
- * pcp_error.c
diff --git a/databases/pgpool-II-30/files/patch-pcp_attach_node.c b/databases/pgpool-II-30/files/patch-pcp_attach_node.c
deleted file mode 100644
index 6453f9f244be..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp_attach_node.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_attach_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_attach_node.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_attach_node.c
---- pcp/pcp_attach_node.c 29 Jan 2008 01:56:37 -0000 1.2
-+++ pcp/pcp_attach_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,23 +87,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_attach_node - attach a node from pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_attach_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_attach_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_attach_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-30/files/patch-pcp_detach_node.c b/databases/pgpool-II-30/files/patch-pcp_detach_node.c
deleted file mode 100644
index df68f227e370..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp_detach_node.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_detach_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_detach_node.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_detach_node.c
---- pcp/pcp_detach_node.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_detach_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,23 +87,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_detach_node - detach a node from pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_detach_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_detach_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_detach_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-30/files/patch-pcp_node_count.c b/databases/pgpool-II-30/files/patch-pcp_node_count.c
deleted file mode 100644
index 295868a121dd..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp_node_count.c
+++ /dev/null
@@ -1,104 +0,0 @@
-Index: pcp/pcp_node_count.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_node_count.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_node_count.c
---- pcp/pcp_node_count.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_node_count.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,53 +39,64 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int node_count;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6) {
-+ if (argc != 5) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN) {
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- pcp_set_timeout(timeout);
-
-@@ -112,8 +124,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_node_count - display the total number of nodes under pgpool-II's control\n\n");
-- fprintf(stderr, "Usage: pcp_node_count timeout hostname port# username password\n");
-+ fprintf(stderr, "Usage: pcp_node_count [-d] timeout hostname port# username password\n");
- fprintf(stderr, "Usage: pcp_node_count -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-30/files/patch-pcp_node_info.c b/databases/pgpool-II-30/files/patch-pcp_node_info.c
deleted file mode 100644
index ae9cb9b33f62..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp_node_info.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_node_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_node_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_node_info.c
---- pcp/pcp_node_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_node_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,36 +40,47 @@
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
- BackendInfo *backend_info;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -76,23 +88,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -132,8 +144,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_node_info - display a pgpool-II node's information\n\n");
-- fprintf(stderr, "Usage: pcp_node_info timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_node_info [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_node_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-30/files/patch-pcp_proc_count.c b/databases/pgpool-II-30/files/patch-pcp_proc_count.c
deleted file mode 100644
index 326522770ea0..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp_proc_count.c
+++ /dev/null
@@ -1,93 +0,0 @@
-Index: pcp/pcp_proc_count.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_proc_count.c,v
-retrieving revision 1.3
-diff -u -r1.3 pcp_proc_count.c
---- pcp/pcp_proc_count.c 29 Jan 2008 01:56:38 -0000 1.3
-+++ pcp/pcp_proc_count.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,53 +40,64 @@
- char pass[MAX_USER_PASSWD_LEN];
- int process_count;
- int *process_list = NULL;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6) {
-+ if (argc != 5) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN) {
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- pcp_set_timeout(timeout);
-
diff --git a/databases/pgpool-II-30/files/patch-pcp_proc_info.c b/databases/pgpool-II-30/files/patch-pcp_proc_info.c
deleted file mode 100644
index a573ff5c26ef..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp_proc_info.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_proc_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_proc_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_proc_info.c
---- pcp/pcp_proc_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_proc_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -40,36 +41,47 @@
- int processID;
- ProcessInfo *process_info;
- int array_size;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -77,23 +89,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- processID = atoi(argv[6]);
-+ processID = atoi(argv[5]);
- if (processID < 0)
- {
- errorcode = INVALERR;
-@@ -142,8 +154,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_proc_info - display a pgpool-II child process' information\n\n");
-- fprintf(stderr, "Usage: pcp_proc_info timeout hostname port# username password PID\n");
-+ fprintf(stderr, "Usage: pcp_proc_info [-d] timeout hostname port# username password PID\n");
- fprintf(stderr, "Usage: pcp_proc_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-30/files/patch-pcp_recovery_node.c b/databases/pgpool-II-30/files/patch-pcp_recovery_node.c
deleted file mode 100644
index c44445836a47..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp_recovery_node.c
+++ /dev/null
@@ -1,120 +0,0 @@
-Index: pcp/pcp_recovery_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_recovery_node.c,v
-retrieving revision 1.3
-diff -u -r1.3 pcp_recovery_node.c
---- pcp/pcp_recovery_node.c 12 Mar 2008 04:53:51 -0000 1.3
-+++ pcp/pcp_recovery_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,30 +87,30 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
--
-+
- pcp_set_timeout(timeout);
-
- if (pcp_connect(host, port, user, pass))
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_recovery_node - recovery a node\n\n");
-- fprintf(stderr, "Usage: pcp_recovery_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_recovery_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_recovery_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-30/files/patch-pcp_stop_pgpool.c b/databases/pgpool-II-30/files/patch-pcp_stop_pgpool.c
deleted file mode 100644
index 4730c6aeea60..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp_stop_pgpool.c
+++ /dev/null
@@ -1,119 +0,0 @@
-Index: pcp/pcp_stop_pgpool.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_stop_pgpool.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_stop_pgpool.c
---- pcp/pcp_stop_pgpool.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_stop_pgpool.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- char mode;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,29 +87,29 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- if (strlen(argv[6]) != 1)
-+ if (strlen(argv[5]) != 1)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- mode = argv[6][0];
-+ mode = argv[5][0];
- if (mode != 's' && mode != 'f' && mode != 'i')
- {
- errorcode = INVALERR;
-@@ -131,8 +143,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_stop_pgpool - terminate pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_stop_pgpool timeout hostname port# username password mode\n");
-+ fprintf(stderr, "Usage: pcp_stop_pgpool [-d] timeout hostname port# username password mode\n");
- fprintf(stderr, "Usage: pcp_stop_pgpool -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-30/files/patch-pcp_systemdb_info.c b/databases/pgpool-II-30/files/patch-pcp_systemdb_info.c
deleted file mode 100644
index 4cd3094b4288..000000000000
--- a/databases/pgpool-II-30/files/patch-pcp_systemdb_info.c
+++ /dev/null
@@ -1,109 +0,0 @@
-Index: pcp/pcp_systemdb_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_systemdb_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_systemdb_info.c
---- pcp/pcp_systemdb_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_systemdb_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,36 +40,47 @@
- char pass[MAX_USER_PASSWD_LEN];
- SystemDBInfo *systemdb_info;
- int i, j;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6)
-+ if (argc != 5)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -76,21 +88,21 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- if (pcp_connect(host, port, user, pass))
- {
-@@ -146,8 +158,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_systemdb_info - display the pgpool-II systemDB information\n\n");
-- fprintf(stderr, "Usage: pcp_systemdb_info timeout hostname port# username password\n");
-+ fprintf(stderr, "Usage: pcp_systemdb_info [-d] timeout hostname port# username password\n");
- fprintf(stderr, "Usage: pcp_systemdb_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II-30/files/patch-pool_sema.c b/databases/pgpool-II-30/files/patch-pool_sema.c
deleted file mode 100644
index a2faf136dc70..000000000000
--- a/databases/pgpool-II-30/files/patch-pool_sema.c
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: pool_sema.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pool_sema.c,v
-retrieving revision 1.4
-diff -u -r1.4 pool_sema.c
---- pool_sema.c 29 Jan 2008 01:56:36 -0000 1.4
-+++ pool_sema.c 29 Dec 2008 05:15:44 -0000
-@@ -82,7 +82,7 @@
-
- if (semId < 0)
- {
-- pool_error("could not create semaphores: %s", strerror(errno));
-+ pool_error("could not create %d semaphores: %s", numSems, strerror(errno));
- return -1;
- }
-
diff --git a/databases/pgpool-II/Makefile b/databases/pgpool-II/Makefile
index 8ce0ea60c427..0ca4f35ecdf5 100644
--- a/databases/pgpool-II/Makefile
+++ b/databases/pgpool-II/Makefile
@@ -6,9 +6,9 @@
#
PORTNAME= pgpool-II
-PORTVERSION= 2.1
+PORTVERSION= 2.2
CATEGORIES= databases
-MASTER_SITES= http://pgfoundry.org/frs/download.php/1843/
+MASTER_SITES= http://pgfoundry.org/frs/download.php/2108/
MAINTAINER= kuriyama@FreeBSD.org
COMMENT= A connection pool server for PostgreSQL
@@ -16,6 +16,7 @@ COMMENT= A connection pool server for PostgreSQL
USE_GMAKE= yes
GNU_CONFIGURE= yes
USE_PGSQL= yes
+USE_LDCONFIG= yes
CONFLICTS= pgpool-3.*
USE_RC_SUBR= pgpool
@@ -40,7 +41,7 @@ pre-install:
${MKDIR} ${DATADIR} ${EXAMPLESDIR}
post-install:
- @cd ${WRKSRC}/sql/pgpool-recovery && ${GMAKE} install
+ @cd ${WRKSRC}/sql/pgpool-recovery && ${GMAKE} ${INSTALL_TARGET}
${INSTALL_DATA} ${WRKSRC}/sample/dist_def_pgbench.sql ${DATADIR}
${INSTALL_DATA} ${WRKSRC}/sample/replicate_def_pgbench.sql ${DATADIR}
.for f in pgpool_recovery pgpool_recovery_pitr pgpool_remote_start
diff --git a/databases/pgpool-II/distinfo b/databases/pgpool-II/distinfo
index 98942f76876a..9ea234ead9ca 100644
--- a/databases/pgpool-II/distinfo
+++ b/databases/pgpool-II/distinfo
@@ -1,3 +1,3 @@
-MD5 (pgpool-II-2.1.tar.gz) = cf02f9358f46849bd526798868e13162
-SHA256 (pgpool-II-2.1.tar.gz) = 8834b6ca01eab57d2c947c1016f164e0538e45242f1d3a3fa99932dae87ba890
-SIZE (pgpool-II-2.1.tar.gz) = 932731
+MD5 (pgpool-II-2.2.tar.gz) = 3dc286e2217478acbc05f127e74bd300
+SHA256 (pgpool-II-2.2.tar.gz) = 2a404dd3965c5d869c17ab0c031395a43445d6fcf0c72df8bd78d9629b8ed25b
+SIZE (pgpool-II-2.2.tar.gz) = 961675
diff --git a/databases/pgpool-II/files/patch-pcp.c b/databases/pgpool-II/files/patch-pcp.c
deleted file mode 100644
index 72eb5d9632ec..000000000000
--- a/databases/pgpool-II/files/patch-pcp.c
+++ /dev/null
@@ -1,598 +0,0 @@
-Index: pcp/pcp.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp.c,v
-retrieving revision 1.7
-diff -u -r1.7 pcp.c
---- pcp/pcp.c 8 Feb 2008 08:10:43 -0000 1.7
-+++ pcp/pcp.c 29 Dec 2008 05:15:44 -0000
-@@ -42,6 +42,11 @@
- struct timeval pcp_timeout;
-
- static PCP_CONNECTION *pc;
-+#ifdef DEBUG
-+static int debug = 1;
-+#else
-+static int debug = 0;
-+#endif
- static int pcp_authorize(char *username, char *password);
-
- /* --------------------------------
-@@ -62,9 +67,7 @@
-
- if (pc != NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection to backend \"%s\" already exists\n", hostname);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection to backend \"%s\" already exists\n", hostname);
- return 0;
- }
-
-@@ -76,9 +79,7 @@
-
- if (fd < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not create socket\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not create socket\n");
- errorcode = SOCKERR;
- return -1;
- }
-@@ -100,9 +101,7 @@
-
- if (connect(fd, (struct sockaddr *) &unix_addr, sizeof(unix_addr)) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", unix_addr.sun_path);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", unix_addr.sun_path);
- close(fd);
- errorcode = CONNERR;
- return -1;
-@@ -113,9 +112,7 @@
- fd = socket(AF_INET, SOCK_STREAM, 0);
- if (fd < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not create socket\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not create socket\n");
- errorcode = SOCKERR;
- return -1;
- }
-@@ -123,9 +120,7 @@
- if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
- (char *) &on, sizeof(on)) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not set socket option\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not set socket option\n");
- close(fd);
- errorcode = SOCKERR;
- return -1;
-@@ -136,9 +131,7 @@
- hp = gethostbyname(hostname);
- if ((hp == NULL) || (hp->h_addrtype != AF_INET))
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not retrieve hostname\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not retrieve hostname\n");
- close(fd);
- errorcode = HOSTERR;
- return -1;
-@@ -151,9 +144,7 @@
- len = sizeof(struct sockaddr_in);
- if (connect(fd, (struct sockaddr *) &addr, len) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", hostname);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not connect to \"%s\"\n", hostname);
- close(fd);
- errorcode = CONNERR;
- return -1;
-@@ -163,9 +154,7 @@
- pc = pcp_open(fd);
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not allocate buffer space\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not allocate buffer space\n");
- close(fd);
- return -1;
- }
-@@ -202,9 +191,7 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
-
-@@ -243,14 +230,10 @@
- pcp_write(pc, encrypt_buf, strlen(encrypt_buf)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"R\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"R\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -265,15 +248,11 @@
- }
- if (pcp_read(pc, buf, rsize - sizeof(int)))
- return -1;
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'r')
-@@ -284,9 +263,7 @@
- return 0;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: authentication failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: authentication failed. reason=%s\n", buf);
- errorcode = AUTHERR;
- }
- free(buf);
-@@ -305,9 +282,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- return;
- }
-
-@@ -318,9 +293,7 @@
- {
- /* backend had closed connection already */
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"X\", len=%d\n", sizeof(int));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"X\", len=%d\n", sizeof(int));
-
- pcp_close(pc);
- pc = NULL;
-@@ -339,9 +312,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -352,14 +323,10 @@
- pcp_write(pc, &mode, sizeof(char));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"T\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"T\", len=%d\n", ntohl(wsize));
-
- return 0;
- }
-@@ -381,9 +348,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -393,14 +358,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"L\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"L\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -419,15 +380,11 @@
- return -1;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'l')
-@@ -466,9 +423,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -481,14 +436,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"I\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"I\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return NULL;
-@@ -507,15 +458,11 @@
- return NULL;
- }
-
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- free(buf);
- return NULL;
-@@ -578,9 +525,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -590,14 +535,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"N\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"N\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return NULL;
-@@ -615,15 +556,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -685,9 +622,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -700,14 +635,10 @@
- pcp_write(pc, process_id, strlen(process_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"P\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"P\", len=%d\n", ntohl(wsize));
-
- while (1)
- {
-@@ -727,15 +658,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -836,9 +763,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return NULL;
- }
-@@ -848,14 +773,10 @@
- pcp_write(pc, &wsize, sizeof(int));
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"S\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"S\", len=%d\n", ntohl(wsize));
-
- while (1) {
- if (pcp_read(pc, &tos, 1))
-@@ -874,15 +795,11 @@
- free(buf);
- return NULL;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- free(buf);
- errorcode = BACKENDERR;
- return NULL;
-@@ -1166,9 +1083,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1181,14 +1096,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1206,15 +1117,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'd')
-@@ -1249,9 +1156,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1264,14 +1169,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1289,15 +1190,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'c')
-@@ -1334,9 +1231,7 @@
-
- if (pc == NULL)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: connection does not exist\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: connection does not exist\n");
- errorcode = NOCONNERR;
- return -1;
- }
-@@ -1349,14 +1244,10 @@
- pcp_write(pc, node_id, strlen(node_id)+1);
- if (pcp_flush(pc) < 0)
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: could not send data to backend\n");
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: could not send data to backend\n");
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: send: tos=\"D\", len=%d\n", ntohl(wsize));
-
- if (pcp_read(pc, &tos, 1))
- return -1;
-@@ -1374,15 +1265,11 @@
- free(buf);
- return -1;
- }
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: recv: tos=\"%c\", len=%d, data=%s\n", tos, rsize, buf);
-
- if (tos == 'e')
- {
--#ifdef DEBUG
-- fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
--#endif
-+ if (debug) fprintf(stderr, "DEBUG: command failed. reason=%s\n", buf);
- errorcode = BACKENDERR;
- }
- else if (tos == 'c')
-@@ -1398,3 +1285,15 @@
- free(buf);
- return -1;
- }
-+
-+void
-+pcp_enable_debug(void)
-+{
-+ debug = 1;
-+}
-+
-+void
-+pcp_disable_debug(void)
-+{
-+ debug = 0;
-+}
diff --git a/databases/pgpool-II/files/patch-pcp.h b/databases/pgpool-II/files/patch-pcp.h
deleted file mode 100644
index bcf3b0e69e27..000000000000
--- a/databases/pgpool-II/files/patch-pcp.h
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: pcp/pcp.h
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp.h,v
-retrieving revision 1.3
-diff -u -r1.3 pcp.h
---- pcp/pcp.h 29 Jan 2008 01:56:37 -0000 1.3
-+++ pcp/pcp.h 29 Dec 2008 05:15:44 -0000
-@@ -62,6 +62,8 @@
- extern int pcp_attach_node(int nid);
- extern void pcp_set_timeout(long sec);
- extern int pcp_recovery_node(int nid);
-+extern void pcp_enable_debug(void);
-+extern void pcp_disable_debug(void);
-
- /* ------------------------------
- * pcp_error.c
diff --git a/databases/pgpool-II/files/patch-pcp_attach_node.c b/databases/pgpool-II/files/patch-pcp_attach_node.c
deleted file mode 100644
index 6453f9f244be..000000000000
--- a/databases/pgpool-II/files/patch-pcp_attach_node.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_attach_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_attach_node.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_attach_node.c
---- pcp/pcp_attach_node.c 29 Jan 2008 01:56:37 -0000 1.2
-+++ pcp/pcp_attach_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,23 +87,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_attach_node - attach a node from pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_attach_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_attach_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_attach_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II/files/patch-pcp_detach_node.c b/databases/pgpool-II/files/patch-pcp_detach_node.c
deleted file mode 100644
index df68f227e370..000000000000
--- a/databases/pgpool-II/files/patch-pcp_detach_node.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_detach_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_detach_node.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_detach_node.c
---- pcp/pcp_detach_node.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_detach_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,23 +87,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_detach_node - detach a node from pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_detach_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_detach_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_detach_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II/files/patch-pcp_node_count.c b/databases/pgpool-II/files/patch-pcp_node_count.c
deleted file mode 100644
index 295868a121dd..000000000000
--- a/databases/pgpool-II/files/patch-pcp_node_count.c
+++ /dev/null
@@ -1,104 +0,0 @@
-Index: pcp/pcp_node_count.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_node_count.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_node_count.c
---- pcp/pcp_node_count.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_node_count.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,53 +39,64 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int node_count;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6) {
-+ if (argc != 5) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN) {
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- pcp_set_timeout(timeout);
-
-@@ -112,8 +124,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_node_count - display the total number of nodes under pgpool-II's control\n\n");
-- fprintf(stderr, "Usage: pcp_node_count timeout hostname port# username password\n");
-+ fprintf(stderr, "Usage: pcp_node_count [-d] timeout hostname port# username password\n");
- fprintf(stderr, "Usage: pcp_node_count -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II/files/patch-pcp_node_info.c b/databases/pgpool-II/files/patch-pcp_node_info.c
deleted file mode 100644
index ae9cb9b33f62..000000000000
--- a/databases/pgpool-II/files/patch-pcp_node_info.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_node_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_node_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_node_info.c
---- pcp/pcp_node_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_node_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,36 +40,47 @@
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
- BackendInfo *backend_info;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -76,23 +88,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
-@@ -132,8 +144,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_node_info - display a pgpool-II node's information\n\n");
-- fprintf(stderr, "Usage: pcp_node_info timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_node_info [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_node_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II/files/patch-pcp_proc_count.c b/databases/pgpool-II/files/patch-pcp_proc_count.c
deleted file mode 100644
index 326522770ea0..000000000000
--- a/databases/pgpool-II/files/patch-pcp_proc_count.c
+++ /dev/null
@@ -1,93 +0,0 @@
-Index: pcp/pcp_proc_count.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_proc_count.c,v
-retrieving revision 1.3
-diff -u -r1.3 pcp_proc_count.c
---- pcp/pcp_proc_count.c 29 Jan 2008 01:56:38 -0000 1.3
-+++ pcp/pcp_proc_count.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,53 +40,64 @@
- char pass[MAX_USER_PASSWD_LEN];
- int process_count;
- int *process_list = NULL;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6) {
-+ if (argc != 5) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN) {
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN) {
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- pcp_set_timeout(timeout);
-
diff --git a/databases/pgpool-II/files/patch-pcp_proc_info.c b/databases/pgpool-II/files/patch-pcp_proc_info.c
deleted file mode 100644
index a573ff5c26ef..000000000000
--- a/databases/pgpool-II/files/patch-pcp_proc_info.c
+++ /dev/null
@@ -1,112 +0,0 @@
-Index: pcp/pcp_proc_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_proc_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_proc_info.c
---- pcp/pcp_proc_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_proc_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -40,36 +41,47 @@
- int processID;
- ProcessInfo *process_info;
- int array_size;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -77,23 +89,23 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- processID = atoi(argv[6]);
-+ processID = atoi(argv[5]);
- if (processID < 0)
- {
- errorcode = INVALERR;
-@@ -142,8 +154,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_proc_info - display a pgpool-II child process' information\n\n");
-- fprintf(stderr, "Usage: pcp_proc_info timeout hostname port# username password PID\n");
-+ fprintf(stderr, "Usage: pcp_proc_info [-d] timeout hostname port# username password PID\n");
- fprintf(stderr, "Usage: pcp_proc_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II/files/patch-pcp_recovery_node.c b/databases/pgpool-II/files/patch-pcp_recovery_node.c
deleted file mode 100644
index c44445836a47..000000000000
--- a/databases/pgpool-II/files/patch-pcp_recovery_node.c
+++ /dev/null
@@ -1,120 +0,0 @@
-Index: pcp/pcp_recovery_node.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_recovery_node.c,v
-retrieving revision 1.3
-diff -u -r1.3 pcp_recovery_node.c
---- pcp/pcp_recovery_node.c 12 Mar 2008 04:53:51 -0000 1.3
-+++ pcp/pcp_recovery_node.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- int nodeID;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,30 +87,30 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- nodeID = atoi(argv[6]);
-+ nodeID = atoi(argv[5]);
- if (nodeID < 0 || nodeID > MAX_NUM_BACKENDS)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
--
-+
- pcp_set_timeout(timeout);
-
- if (pcp_connect(host, port, user, pass))
-@@ -123,8 +135,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_recovery_node - recovery a node\n\n");
-- fprintf(stderr, "Usage: pcp_recovery_node timeout hostname port# username password nodeID\n");
-+ fprintf(stderr, "Usage: pcp_recovery_node [-d] timeout hostname port# username password nodeID\n");
- fprintf(stderr, "Usage: pcp_recovery_node -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II/files/patch-pcp_stop_pgpool.c b/databases/pgpool-II/files/patch-pcp_stop_pgpool.c
deleted file mode 100644
index 4730c6aeea60..000000000000
--- a/databases/pgpool-II/files/patch-pcp_stop_pgpool.c
+++ /dev/null
@@ -1,119 +0,0 @@
-Index: pcp/pcp_stop_pgpool.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_stop_pgpool.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_stop_pgpool.c
---- pcp/pcp_stop_pgpool.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_stop_pgpool.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -38,36 +39,47 @@
- char user[MAX_USER_PASSWD_LEN];
- char pass[MAX_USER_PASSWD_LEN];
- char mode;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 7)
-+ if (argc != 6)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -75,29 +87,29 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
-- if (strlen(argv[6]) != 1)
-+ if (strlen(argv[5]) != 1)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- mode = argv[6][0];
-+ mode = argv[5][0];
- if (mode != 's' && mode != 'f' && mode != 'i')
- {
- errorcode = INVALERR;
-@@ -131,8 +143,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_stop_pgpool - terminate pgpool-II\n\n");
-- fprintf(stderr, "Usage: pcp_stop_pgpool timeout hostname port# username password mode\n");
-+ fprintf(stderr, "Usage: pcp_stop_pgpool [-d] timeout hostname port# username password mode\n");
- fprintf(stderr, "Usage: pcp_stop_pgpool -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II/files/patch-pcp_systemdb_info.c b/databases/pgpool-II/files/patch-pcp_systemdb_info.c
deleted file mode 100644
index 4cd3094b4288..000000000000
--- a/databases/pgpool-II/files/patch-pcp_systemdb_info.c
+++ /dev/null
@@ -1,109 +0,0 @@
-Index: pcp/pcp_systemdb_info.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pcp/pcp_systemdb_info.c,v
-retrieving revision 1.2
-diff -u -r1.2 pcp_systemdb_info.c
---- pcp/pcp_systemdb_info.c 29 Jan 2008 01:56:38 -0000 1.2
-+++ pcp/pcp_systemdb_info.c 29 Dec 2008 05:15:44 -0000
-@@ -23,6 +23,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <unistd.h>
-
- #include "pcp.h"
-
-@@ -39,36 +40,47 @@
- char pass[MAX_USER_PASSWD_LEN];
- SystemDBInfo *systemdb_info;
- int i, j;
-+ int ch;
-
-- if (argc == 2 && (strcmp(argv[1], "-h") == 0) )
-- {
-- usage();
-- exit(0);
-+ while ((ch = getopt(argc, argv, "hd")) != -1) {
-+ switch (ch) {
-+ case 'd':
-+ pcp_enable_debug();
-+ break;
-+
-+ case 'h':
-+ case '?':
-+ default:
-+ usage();
-+ exit(0);
-+ }
- }
-+ argc -= optind;
-+ argv += optind;
-
-- if (argc != 6)
-+ if (argc != 5)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- timeout = atol(argv[1]);
-+ timeout = atol(argv[0]);
- if (timeout < 0) {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-
-- if (strlen(argv[2]) >= MAX_DB_HOST_NAMELEN)
-+ if (strlen(argv[1]) >= MAX_DB_HOST_NAMELEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(host, argv[2]);
-+ strcpy(host, argv[1]);
-
-- port = atoi(argv[3]);
-+ port = atoi(argv[2]);
- if (port <= 1024 || port > 65535)
- {
- errorcode = INVALERR;
-@@ -76,21 +88,21 @@
- myexit(errorcode);
- }
-
-- if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[3]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(user, argv[4]);
-+ strcpy(user, argv[3]);
-
-- if (strlen(argv[5]) >= MAX_USER_PASSWD_LEN)
-+ if (strlen(argv[4]) >= MAX_USER_PASSWD_LEN)
- {
- errorcode = INVALERR;
- pcp_errorstr(errorcode);
- myexit(errorcode);
- }
-- strcpy(pass, argv[5]);
-+ strcpy(pass, argv[4]);
-
- if (pcp_connect(host, port, user, pass))
- {
-@@ -146,8 +158,9 @@
- usage(void)
- {
- fprintf(stderr, "pcp_systemdb_info - display the pgpool-II systemDB information\n\n");
-- fprintf(stderr, "Usage: pcp_systemdb_info timeout hostname port# username password\n");
-+ fprintf(stderr, "Usage: pcp_systemdb_info [-d] timeout hostname port# username password\n");
- fprintf(stderr, "Usage: pcp_systemdb_info -h\n\n");
-+ fprintf(stderr, " -d - enable debug message (optional)\n");
- fprintf(stderr, " timeout - connection timeout value in seconds. command exits on timeout\n");
- fprintf(stderr, " hostname - pgpool-II hostname\n");
- fprintf(stderr, " port# - pgpool-II port number\n");
diff --git a/databases/pgpool-II/files/patch-pool_sema.c b/databases/pgpool-II/files/patch-pool_sema.c
deleted file mode 100644
index a2faf136dc70..000000000000
--- a/databases/pgpool-II/files/patch-pool_sema.c
+++ /dev/null
@@ -1,16 +0,0 @@
-Index: pool_sema.c
-===================================================================
-RCS file: /cvsroot/pgpool/pgpool-II/pool_sema.c,v
-retrieving revision 1.4
-diff -u -r1.4 pool_sema.c
---- pool_sema.c 29 Jan 2008 01:56:36 -0000 1.4
-+++ pool_sema.c 29 Dec 2008 05:15:44 -0000
-@@ -82,7 +82,7 @@
-
- if (semId < 0)
- {
-- pool_error("could not create semaphores: %s", strerror(errno));
-+ pool_error("could not create %d semaphores: %s", numSems, strerror(errno));
- return -1;
- }
-