datapath: Fix check-export-symbol for non-bash shells
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Mon, 27 Apr 2015 05:48:46 +0000 (14:48 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Tue, 28 Apr 2015 01:03:16 +0000 (10:03 +0900)
Avoid using a bash construct (=~) in the target.

An alternative would be to make the configure script require
bash explicitly.  (Currently it doesn't and on NetBSD /bin/ksh
is likely used.)

The code in question was introduced by
commit b296b82a87326e68773b970284b8e012def0e3ba .
("datapath: Check the export of public functions in linux/compat/linux/.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Alex Wang <alexw@nicira.com>
datapath/Makefile.am

index 0b0b0bd..a8e9be4 100644 (file)
@@ -42,19 +42,17 @@ COMPAT_EXPORTS := $(shell $(COMPAT_GET_EXPORTS))
 check-export-symbol:
        @for fun_ in $(COMPAT_FUNCTIONS); do \
           if ! grep -- $${fun_} $(top_srcdir)/datapath/linux/compat/build-aux/export-check-whitelist > /dev/null; then \
-             if [[ ! $${fun_} =~ ^rpl_* ]] \
-                && [[ ! $${fun_} =~ ^ovs_* ]]; then \
+             if ! echo $${fun_} | grep -E '^(rpl|ovs)_'; then \
                 echo "Should prefix $${fun_} with rpl_ or ovs_."; \
                 exit 1; \
              fi; \
           fi; \
        done
        @for fun_ in $(COMPAT_EXPORTS); do \
-          if [[ ! $${fun_} =~ ^rpl_* ]] \
-             && [[ ! $${fun_} =~ ^ovs_* ]]; then \
+          if ! echo $${fun_} | grep -E '^(rpl|ovs)_'; then \
              echo "Should prefix $${fun_} with rpl_ or ovs_."; \
              exit 1; \
           fi; \
        done
 
-all-local: check-export-symbol
\ No newline at end of file
+all-local: check-export-symbol