Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] build: fix umask test
@ 2016-05-31  7:46 Kurt Van Dijck
  2016-05-31  9:53 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Kurt Van Dijck @ 2016-05-31  7:46 UTC (permalink / raw)
  To: buildroot

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@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

^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [Buildroot] [PATCH v2] build: fix umask test
@ 2016-06-19  4:12 Kurt Van Dijck
  2016-06-20 20:51 ` Peter Korsgaard
  0 siblings, 1 reply; 6+ messages in thread
From: Kurt Van Dijck @ 2016-06-19  4:12 UTC (permalink / raw)
  To: buildroot

Some shells' builtin umask does not print 2 leading 0's for the umask.
Switching to bash is done anyway.
This patch switches to bash before the umask test.

Signed-off-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
---
 Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 3f5c3d3..78b44c5 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,11 @@
 # You shouldn't need to mess with anything beyond this point...
 #--------------------------------------------------------------
 
+# we want bash as shell
+SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
+	 else if [ -x /bin/bash ]; then echo /bin/bash; \
+	 else echo sh; fi; fi)
+
 # Trick for always running with a fixed umask
 UMASK = 0022
 ifneq ($(shell umask),$(UMASK))
@@ -227,11 +232,6 @@ else
   Q = @
 endif
 
-# we want bash as shell
-SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
-	 else if [ -x /bin/bash ]; then echo /bin/bash; \
-	 else echo sh; fi; fi)
-
 # kconfig uses CONFIG_SHELL
 CONFIG_SHELL := $(SHELL)
 
-- 
1.8.5.rc3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-06-20 20:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-31  7:46 [Buildroot] [PATCH v2] build: fix umask test Kurt Van Dijck
2016-05-31  9:53 ` Thomas Petazzoni
2016-05-31  9:59   ` Kurt Van Dijck
2016-05-31 10:24     ` Peter Korsgaard
  -- strict thread matches above, loose matches on Subject: below --
2016-06-19  4:12 Kurt Van Dijck
2016-06-20 20:51 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox