On 10/16/2017 07:26 AM, William Tu wrote:
Allow to pass grep's option to OVS_GREP_IFELSE.
One use case is to pass '-w' for exact match.
Signed-off-by: William Tu <[email protected]>
---
acinclude.m4 | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/acinclude.m4 b/acinclude.m4
index 89f88ca8de75..543e1e3f0630 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -326,15 +326,15 @@ AC_DEFUN([OVS_CHECK_DPDK], [
AM_CONDITIONAL([DPDK_NETDEV], test "$DPDKLIB_FOUND" = true)
])
-dnl OVS_GREP_IFELSE(FILE, REGEX, [IF-MATCH], [IF-NO-MATCH])
+dnl OVS_GREP_IFELSE(FILE, REGEX, [IF-MATCH], [IF-NO-MATCH], [OPTION])
dnl
-dnl Greps FILE for REGEX. If it matches, runs IF-MATCH, otherwise IF-NO-MATCH.
-dnl If IF-MATCH is empty then it defines to OVS_DEFINE(HAVE_<REGEX>), with
-dnl <REGEX> translated to uppercase.
+dnl Greps FILE for REGEX with grep's OPTION. If it matches, runs IF-MATCH,
+dnl otherwise IF-NO-MATCH. If IF-MATCH is empty then it defines to
+dnl OVS_DEFINE(HAVE_<REGEX>), with <REGEX> translated to uppercase.
AC_DEFUN([OVS_GREP_IFELSE], [
AC_MSG_CHECKING([whether $2 matches in $1])
if test -f $1; then
- grep '$2' $1 >/dev/null 2>&1
+ grep $5 '$2' $1 >/dev/null 2>&1
status=$?
case $status in
0)
LGTM
Tested-by: Greg Rose <[email protected]>
Reviewed-by: Greg Rose <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev