[PATCH testsuite 1/4] Makefiles: remove bashisms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In Travis CI (Ubuntu), the shell used by Make doesn't understand
bashisms like [[ ... ]]. Replace them with plain [ ... ] and also break
up the conditionals for better readabilty.

Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
---
 policy/Makefile | 4 +++-
 tests/Makefile  | 8 ++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/policy/Makefile b/policy/Makefile
index 672733e..6c49091 100644
--- a/policy/Makefile
+++ b/policy/Makefile
@@ -37,13 +37,15 @@ endif
 
 ifeq ($(SUPPORTS_CIL),y)
 CIL_TARGETS = test_mlsconstrain.cil test_overlay_defaultrange.cil
-ifeq ($(shell [[ $(MAX_KERNEL_POLICY) -ge 32 && $(POL_VERS) -ge 32 ]] && echo true),true)
+ifeq ($(shell [ $(MAX_KERNEL_POLICY) -ge 32 ] && echo true),true)
+ifeq ($(shell [ $(POL_VERS) -ge 32 ] && echo true),true)
 # If other MLS tests get written this can be moved outside of the glblub test
 ifeq ($(POL_TYPE), MLS)
 CIL_TARGETS += test_glblub.cil
 else ifeq ($(POL_TYPE), MCS)
 CIL_TARGETS += test_add_levels.cil test_glblub.cil
 endif # POL_TYPE
+endif # POL_VERS
 endif # MAX_KERNEL_POLICY
 endif # SUPPORTS_CIL
 
diff --git a/tests/Makefile b/tests/Makefile
index bdbdf3e..919335b 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -68,9 +68,13 @@ ifeq ($(shell grep -q key_socket $(POLDEV)/include/support/all_perms.spt && test
 SUBDIRS += key_socket
 endif
 
-ifeq ($(shell [[ $(MAX_KERNEL_POLICY) -ge 32 && ( $(POL_TYPE) == 'MLS' || $(POL_TYPE) == 'MCS' ) && $(POL_VERS) -ge 32 ]]  && echo true),true)
+ifeq ($(shell [ $(MAX_KERNEL_POLICY) -ge 32 ] && echo true),true)
+ifeq ($(shell [ $(POL_TYPE) = 'MLS' ] || [ $(POL_TYPE) = 'MCS' ] && echo true),true)
+ifeq ($(shell [ $(POL_VERS) -ge 32 ] && echo true),true)
 SUBDIRS += glblub
-endif
+endif # POL_VERS
+endif # POL_TYPE
+endif # MAX_KERNEL_POLICY
 
 ifeq ($(shell grep "^SELINUX_INFINIBAND_ENDPORT_TEST=" infiniband_endport/ibendport_test.conf | cut -d'=' -f 2),1)
 SUBDIRS += infiniband_endport
-- 
2.26.2




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux