[U-Boot] [PATCH v4 1/2] tools, config.mk: add binutils-version
Tom Rini
trini at ti.com
Thu Jul 19 17:38:39 CEST 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 07/19/2012 08:21 AM, Mike Frysinger wrote:
> On Thursday 19 July 2012 11:08:10 Tom Rini wrote:
>> On 07/18/2012 08:11 PM, Mike Frysinger wrote:
>>> On Wednesday 18 July 2012 19:45:52 Allen Martin wrote:
>>>> +MAJOR=$($gas --version | head -1 | awk '{print $NF}' | cut
>>>> -d . -f 1) +MINOR=$($gas --version | head -1 | awk '{print
>>>> $NF}' | cut -d . -f 2) + +printf "%02d%02d\\n" $MAJOR $MINOR
>>>
>>> can be replaced with a single awk script:
>>>
>>> $gas --version | awk '{ gsub(/[.]/, " ", $NF) $0 = $NF printf
>>> "%02d%02d\n", $1, $2 exit }'
>>
>> That looks much longer and we call this once so a few execs is
>> noise.
>
> here's a shorter version: $gas --version | awk '{ gsub(/[.]/, " ",
> $NF); $0 = $NF; printf "%02d%02d\n", $1, $2; exit }'
And still over 80 chars before we assign it to a variable. I could
get it to 77 chars with all whitespace removed.
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBAgAGBQJQCCn/AAoJENk4IS6UOR1WFJwP/2pv0lUXUJVJZk1Wb1w2ln2G
MtjUg1ntwrgQmKCb5D67VNCHN2sjtiWi0HGNZDCvHqRz9AGN7BX/Dz8Jx0hKoqf3
S92J7VpKJ+MGpBVpWxlZMNY5FlBnkiVpUCkIQefhz5sUqq1fA2PjCs82MRadr9WP
KmpfDXZ6OBRl7hKqeHVaYaqfCjxaaXqmPLrXh1VXUjA6oYKv0kZcvW9H2kMPyaTd
+shYx0z/TI6UXHmw0CmcoDvPsy9cIBAtqtuqOeP/YP1sIHq1UQBIehfD4ji4JZAl
wWKymSJwtcIl6hCV+IV3/wGczIdvRfyraa8mN5/MrVWLbgiytW/OOnix7mYlw4ov
ysXz/5pg7dPkaHxczvANpVO7PkzRJZKMQhjyuZmVDSDdEzPks9QHWt3miRErXjMc
kkD2LaKkV9hBBSqD6+/vfd45zLI125UDfkkRLLwr67bHcrGkdBbojOXE357vQx7N
ELp2FPOwfXkBOw//P0KhlVtc9T1Li+LqqfjqzbYQkPYbHzcAal7SPERzxION+pFO
00M+uYwtxPDm/wvmk033VTZNaLdvLHU6Zg1wkKwj484MZ/x+ptFwDvTwppRw/Kme
4JuhjxWGwQFu9tkV0gWFd2D2uYZzbDt5VnZkntp1BxyXEHJ3FvvUvMryr8ZqEAIS
Ss/IDqUlIsctLDiDziSD
=9xj8
-----END PGP SIGNATURE-----
More information about the U-Boot
mailing list