From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] build: fix umask test
Date: Tue, 31 May 2016 11:53:26 +0200 [thread overview]
Message-ID: <20160531115326.5b360fcb@free-electrons.com> (raw)
In-Reply-To: <20160531074622.GB26685@airbook>
Hello,
On Tue, 31 May 2016 09:46:22 +0200, Kurt Van Dijck wrote:
> 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))
Doesn't this makes the assumption that "umask" will always return a
value that starts with two zeros ?
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-05-31 9:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 7:46 [Buildroot] [PATCH v2] build: fix umask test Kurt Van Dijck
2016-05-31 9:53 ` Thomas Petazzoni [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160531115326.5b360fcb@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox