[U-Boot] [PATCH] scripts: fix binutils-version.sh for 'as' without a package.

Bill Pringlemeir bpringlemeir at nbsps.com
Wed Jan 7 16:42:47 CET 2015


On  7 Jan 2015, yamada.m at jp.panasonic.com wrote:

> Thanks for your patch.
>
> I think this works but could it be more simplified?
>
> In your commit-log, you mentioned only some of tools provide
> additional information surrounded by brackets.
>
> If so, we can
> [1] remove blackets
> [2] and then take the first word that consists of numbers+period
>
>
> Like this:
>
> version_string=$($gas --version | head -1 | \
> 	sed -e 's/(.*)//' -e 's/[^0-9.]*\([0-9.]*\).*/\1/')
>
> MAJOR=$(echo $version_string | cut -d . -f 1)
> MINOR=$(echo $version_string | cut -d . -f 2)
>
> printf "%02d%02d\\n" $MAJOR $MINOR

I realized I didn't need to spawn sed twice, but removing the
'(package)' stuff seems better.  Thanks for giving me a reason to fix
the whitespace.

Also the string,

 GNU assembler version 2.24.0-6.fc21 20140613

Was originally reporting '2014061320140613' prior to your version.  The
new version reports '0224' like all the others.

Fwiw,
Bill.


More information about the U-Boot mailing list