[Buildroot] [PATCH v2] build: fix umask test

Kurt Van Dijck dev.kurt at vandijck-laurijssen.be
Tue May 31 07:46:22 UTC 2016


Some shells' builtin umask does not print 2 leading 0's for the umask.
Not doing so would break the comparison.
zsh does not parse 022 as octal, so it is easier to compare the umask
as ascii string.
This patch fixes the umask comparison across different shells.

Signed-off-by: Kurt Van Dijck <dev.kurt at vandijck-laurijssen.be>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 63502d0..846343d 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@
 
 # Trick for always running with a fixed umask
 UMASK = 0022
-ifneq ($(shell umask),$(UMASK))
+ifneq (00$(shell umask | sed -e "s/^0*//g"),$(UMASK))
 .PHONY: _all $(MAKECMDGOALS)
 
 $(MAKECMDGOALS): _all
-- 
1.8.5.rc3




More information about the buildroot mailing list