From 00961f7cc5cb65e3d926a382748f231ded90d137 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 8 Dec 2010 14:23:54 -0800 Subject: [PATCH] Avoid using "grep -q" outside of GNU/Linux specific utilities. According to the Autoconf manual, "grep -q" is not portable, so instead redirect stdout to /dev/null. --- Makefile.am | 2 +- tests/ovsdb-tool.at | 2 +- utilities/ovs-pki.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8517b2b8..457513cb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -88,7 +88,7 @@ SUFFIXES += .in -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \ -e 's,[@]ovsdbmonitordir[@],$(ovsdbmonitordir),g' \ > $@.tmp - @if head -n 1 $@.tmp | grep -q '#!'; then \ + @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \ echo chmod +x $@.tmp; \ chmod +x $@.tmp; \ fi diff --git a/tests/ovsdb-tool.at b/tests/ovsdb-tool.at index 7f09d349..c2ec8810 100644 --- a/tests/ovsdb-tool.at +++ b/tests/ovsdb-tool.at @@ -45,7 +45,7 @@ AT_CHECK([[ovsdb-tool transact db ' AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [[[{"uuid":["uuid","<0>"]},{}] ]]) -AT_CHECK([grep -q "add row for 5" db]) +AT_CHECK([grep "add row for 5" db], [0], [ignore]) AT_CLEANUP AT_SETUP([ovsdb-tool compact]) diff --git a/utilities/ovs-pki.in b/utilities/ovs-pki.in index 1f528690..9a55961f 100755 --- a/utilities/ovs-pki.in +++ b/utilities/ovs-pki.in @@ -361,7 +361,7 @@ fingerprint() { file=$1 name=${1-$2} date=$(date -r $file) - if grep -q -e '-BEGIN CERTIFICATE-' "$file"; then + if grep -e '-BEGIN CERTIFICATE-' "$file" > /dev/null; then fingerprint=$(openssl x509 -noout -in "$file" -fingerprint | sed 's/SHA1 Fingerprint=//' | tr -d ':') else -- 2.30.2