From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752005AbcHGURF (ORCPT ); Sun, 7 Aug 2016 16:17:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:33878 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751107AbcHGURE (ORCPT ); Sun, 7 Aug 2016 16:17:04 -0400 Subject: Re: [PATCH] scripts: Translate profile2linkerlist. To: Jorge Natz , arjan@linux.intel.com References: <57A77EF6.5030200@gmail.com> Cc: linux-kernel@vger.kernel.org, trivial@kernel.org From: Michal Marek X-Enigmail-Draft-Status: N1110 Message-ID: <57A7972D.7070206@suse.com> Date: Sun, 7 Aug 2016 22:16:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <57A77EF6.5030200@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne 7.8.2016 v 20:33 Jorge Natz napsal(a): > -while (<>) { > - my $line = $_; > - > - $_ =~ /\W*[0-9]+\W*([a-zA-Z\_0-9]+)\W*[0-9]+/; > - > - print "*(.text.$1)\n" [...] > + LINE=$( echo $LINE | sed -e s"/[0-9.][0-9.]*//" -e s"/[0-9.][0-9.]*$//" | xargs) > + case $LINE in *unknown*|*total* ) continue > + ;; > + esac > + echo '*(.text.'$LINE')' > +done The two regular expressions are not equivalent and the shell version does not take into account the locale-dependent decimal separator. It also does not handle localized "total", but that's an issue of the perl version as well. Since this script is not used during kernel build, its dependency on perl is less of an issue and it can be left as is. Michal