php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #54318
Patch Grep_dash_q_portability_fix revision 2011-03-21 13:20 UTC by bwalton at artsci dot utoronto dot ca

Patch Grep_dash_q_portability_fix for PostgreSQL related Bug #54318

Patch version 2011-03-21 13:20 UTC

Return to Bug #54318 | Download this patch
Patch Revisions:

Developer: bwalton@artsci.utoronto.ca

From ef96c4d5a2032ec209823d486d93fb6d3d294178 Mon Sep 17 00:00:00 2001
From: Ben Walton <bwalton@artsci.utoronto.ca>
Date: Mon, 21 Mar 2011 09:15:06 -0400
Subject: [PATCH] Corrent non-portable use of grep -q in pdo_pgsql configuration

The -q option to grep isn't portable.  Use of this option was causing
the openssl detection in the pdo pgsql module to fail.  As per the
autoconf recommendations, the check is now changed to discard the
output from grep and test the exit status instead.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 ext/pdo_pgsql/config.m4 |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ext/pdo_pgsql/config.m4 b/ext/pdo_pgsql/config.m4
index f75d791..f69f4d0 100644
--- a/ext/pdo_pgsql/config.m4
+++ b/ext/pdo_pgsql/config.m4
@@ -69,7 +69,8 @@ if test "$PHP_PDO_PGSQL" != "no"; then
   AC_DEFINE(HAVE_PDO_PGSQL,1,[Whether to build PostgreSQL for PDO support or not])
 
   AC_MSG_CHECKING([for openssl dependencies])
-  if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then
+  grep openssl $PGSQL_INCLUDE/libpq-fe.h >/dev/null 2>&1
+  if [ $? -eq 0 ] ; then
     AC_MSG_RESULT([yes])
     dnl First try to find pkg-config
     AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-- 
1.7.1

 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 15:02:26 2014 UTC