From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 1/9] Validate dtc is new enough
Date: Tue, 25 Jun 2013 12:07:21 -0600 [thread overview]
Message-ID: <51C9DC59.9020505@wwwdotorg.org> (raw)
In-Reply-To: <20130625172257.GP24305@book.gsilab.sittig.org>
On 06/25/2013 11:22 AM, Gerhard Sittig wrote:
> On Mon, Jun 24, 2013 at 09:43 -0600, Stephen Warren wrote:
>>
>> +checkdtc:
>> + @if test $(call dtc-version) -lt 0104; then \
>> + echo '*** Your dtc is too old, please upgrade to dtc 1.4 or newer'; \
>> + false; \
>> + fi
>
> ... and ...
>
>> --- /dev/null
>> +++ b/tools/dtc-version.sh
>> @@ -0,0 +1,20 @@
>> +#!/bin/sh
>> +#
>> +# dtc-version dtc-command
>> +#
>> +# Prints the dtc version of `dtc-command' in a canonical 4-digit form
>> +# such as `0222' for binutils 2.22
>> +#
>
> So the numbers get converted to something that's neatly aligned
> and free of whitespace and can get sorted alphabetically.
>
> But the numbers get passed to $SHELL and the builtin test(1)
> command, and get compared numerically ('-lt' operator).
>
> Does that mean that the test break with digits beyond seven, when
> numbers no longer can get interpreted as valid octal numbers?
I'm pretty sure sh treats the numbers as decimal. Testing appears to
support this:
[swarren at swarren-lx1 kernel.git]$ if [ 0104 -lt 0104 ]; then echo yes;
else echo no; fi
no
[swarren at swarren-lx1 kernel.git]$ if [ 0103 -lt 0104 ]; then echo yes;
else echo no; fi
yes
[swarren at swarren-lx1 kernel.git]$ if [ 0803 -lt 0104 ]; then echo yes;
else echo no; fi
no
[swarren at swarren-lx1 kernel.git]$ if [ 0802 -lt 0804 ]; then echo yes;
else echo no; fi
yes
[swarren at swarren-lx1 kernel.git]$ if [ 0804 -lt 0804 ]; then echo yes;
else echo no; fi
no
[swarren at swarren-lx1 kernel.git]$ if [ 0806 -lt 0804 ]; then echo yes;
else echo no; fi
no
next prev parent reply other threads:[~2013-06-25 18:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 15:43 [U-Boot] [PATCH V2 0/9] rely on latest dtc, simplify Stephen Warren
2013-06-24 15:43 ` [U-Boot] [PATCH V2 1/9] Validate dtc is new enough Stephen Warren
2013-06-25 0:45 ` Simon Glass
2013-06-25 14:47 ` Stephen Warren
2013-06-25 14:58 ` Simon Glass
2013-06-25 17:22 ` Gerhard Sittig
2013-06-25 18:07 ` Stephen Warren [this message]
2013-06-24 15:43 ` [U-Boot] [PATCH V2 2/9] xilinx: move microblaze-generic .dts to standard location Stephen Warren
2013-06-24 15:43 ` [U-Boot] [PATCH V2 3/9] dts/Makefile: simplify dtc invocation Stephen Warren
2013-06-25 0:47 ` Simon Glass
2013-06-24 15:43 ` [U-Boot] [PATCH V2 4/9] dts/Makefile: unify cpp/dtc include paths Stephen Warren
2013-06-24 15:43 ` [U-Boot] [PATCH V2 5/9] dt: don't use ARCH_CPU_DTS Stephen Warren
2013-06-24 15:43 ` [U-Boot] [PATCH V2 6/9] dts/Makefile: don't define ARCH_CPU_DTS, BOARD_DTS Stephen Warren
2013-06-24 15:43 ` [U-Boot] [PATCH V2 7/9] config: don't define CONFIG_ARCH_DEVICE_TREE Stephen Warren
2013-06-24 15:43 ` [U-Boot] [PATCH V2 8/9] dts/Makefile: don't use cpp -P Stephen Warren
2013-06-24 15:43 ` [U-Boot] [PATCH V2 9/9] dts/Makefile: pass -undef -D__DTS__ to cpp Stephen Warren
2013-06-24 20:35 ` [U-Boot] [PATCH V2 0/9] rely on latest dtc, simplify Tom Rini
2013-07-24 0:31 ` Stephen Warren
2013-07-24 12:41 ` Tom Rini
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=51C9DC59.9020505@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=u-boot@lists.denx.de \
/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