From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bill Pringlemeir Date: Wed, 07 Jan 2015 10:42:47 -0500 Subject: [U-Boot] [PATCH] scripts: fix binutils-version.sh for 'as' without a package. In-Reply-To: <20150107210129.B9C2.AA925319@jp.panasonic.com> (Masahiro Yamada's message of "Wed, 07 Jan 2015 21:01:29 +0900") References: <1420583133-15012-1-git-send-email-bpringlemeir@nbsps.com> <1420583899-15338-1-git-send-email-bpringlemeir@nbsps.com> <20150107210129.B9C2.AA925319@jp.panasonic.com> Message-ID: <87k30y7g20.fsf@nbsps.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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.