xsm/policy: remove gawk-ism line in Makefile
PATCH 1/1 xsm/policy: remove gawk-ism line in Makefile
Translate gawk regex to mawk regex to allow using mawk. The new regex works on both gawk and mawk.
Signed-off-by Wei Liu <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Daniel De Graaf <[email protected]>
--- tools/flask/policy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/flask/policy/Makefile +1 -1
@@ -86,7 +86,7 @@ DETECTED_MODS := $(sort $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te))) MODENABLED := on # extract settings from modules.conf -ENABLED_MODS := $(foreach mod,$(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(MODENABLED)") print $$1 }' $(MOD_CONF) 2> /dev/null),$(subst ./,,$(shell find -iname $(mod).te))) +ENABLED_MODS := $(foreach mod,$(shell awk '/^[ \t]*[a-z]/{ if ($$3 == "$(MODENABLED)") print $$1 }' $(MOD_CONF) 2> /dev/null),$(subst ./,,$(shell find -iname $(mod).te))) ALL_MODULES := $(filter $(ENABLED_MODS),$(DETECTED_MODS))
Signature · 1 line
1.9.1
Quoted 2 lines · Wei Liu
Translate gawk regex to mawk regex to allow using mawk. The new regex works on both gawk and mawk.
I think [[:alpha:]] might include A-Z too, but I presume that doesn't affect our inputs or your tests would have failed. So for my part:
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
Acked-by Ian Campbell <[email protected]>
Quoted 19 lines
Cc Ian Jackson <[email protected]>Cc Daniel De Graaf <[email protected]>--- tools/flask/policy/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/flask/policy/Makefile +1
-1@@ -86,7 +86,7 @@ DETECTED_MODS := $(sort $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te))) MODENABLED := on # extract settings from modules.conf -ENABLED_MODS := $(foreach mod,$(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(MODENABLED)") print $$1 }' $(MOD_CONF) 2> /dev/null),$(subst ./,,$(shell find -iname $(mod).te))) +ENABLED_MODS := $(foreach mod,$(shell awk '/^[ \t]*[a-z]/{ if ($$3 == "$(MODENABLED)") print $$1 }' $(MOD_CONF) 2> /dev/null),$(subst ./,,$(shell find -iname $(mod).te))) ALL_MODULES := $(filter $(ENABLED_MODS),$(DETECTED_MODS))
Quoted 4 lines · Wei Liu
Translate gawk regex to mawk regex to allow using mawk. The new regex works on both gawk and mawk.
Signed-off-by Wei Liu <[email protected]>
Acked-by Daniel De Graaf <[email protected]>
Ian Campbell
AppliedQuoted 7 lines · Daniel De Graaf
Quoted 4 lines · Wei Liu
Translate gawk regex to mawk regex to allow using mawk. The new regex works on both gawk and mawk.
Signed-off-by Wei Liu <[email protected]>Acked-by Daniel De Graaf <[email protected]>
Applied, thanks.