From: Amerigo Wang <xiyou.wangcong@gmail.com>
To: Dick Streefland <dick@streefland.net>
Cc: Amerigo Wang <xiyou.wangcong@gmail.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kconfig: simplification of scripts/extract-ikconfig
Date: Mon, 29 Jun 2009 10:51:46 +0800 [thread overview]
Message-ID: <20090629025146.GA5998@cr0.nay.redhat.com> (raw)
In-Reply-To: <20090624133148.GA12878@streefland.net>
On Wed, Jun 24, 2009 at 03:31:48PM +0200, Dick Streefland wrote:
>On Wednesday 2009-06-24 13:46, Dick Streefland wrote:
>| Because I don't want to rely on a particular version of grep, I've
>| modified the script to use perl instead. I hope that's OK. Below is
>| a new patch.
><snip>
Sorry for the delay, I missed this patch...
>
>I found a way to work around the differences in behavior of grep.
>Older versions of grep report the byte offset of the start of the
>line instead of the byte offset of the pattern. By using tr to
>make sure the pattern is always at the start of a "line", both old
>and new versions of grep can be used.
This is very tricky...
<snip>
>+
>+gz1='\037\213\010'
>+gz2='01'
>+cf1='IKCFG_ST\037\213\010'
>+cf2='0123456789'
>+
>+dump_config()
> {
>- echo " usage: extract-ikconfig [b]zImage_filename"
>-}
>-
>-clean_up()
>-{
>- if [ "$TMPFILE" != "" ]; then
>- rm -f $TMPFILE
>+ if pos=`tr "$cf1\n$cf2" "\n$cf2=" < "$1" | grep -abo "^$cf2"`
Does this work?
My quick test shows no...
I still can't get the right offset number with this trick.
P.S. My grep is 2.5.1.
next prev parent reply other threads:[~2009-06-29 2:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-23 22:52 Dick Streefland
2009-06-24 2:15 ` Amerigo Wang
2009-06-24 11:46 ` Dick Streefland
2009-06-24 13:31 ` Dick Streefland
2009-06-29 2:51 ` Amerigo Wang [this message]
2009-06-29 11:36 ` Dick Streefland
2009-07-09 2:38 ` Amerigo Wang
2009-07-09 8:26 ` Dick Streefland
2009-07-10 7:55 ` Amerigo Wang
2009-07-10 9:54 ` Dick Streefland
2009-07-17 21:17 ` Sam Ravnborg
2009-07-17 23:08 ` Dick Streefland
2009-07-18 7:06 ` Sam Ravnborg
2009-10-06 20:35 Dick Streefland
2009-10-07 2:11 ` Steven Rostedt
2009-10-07 8:41 ` Dick Streefland
2009-10-07 13:20 ` Steven Rostedt
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=20090629025146.GA5998@cr0.nay.redhat.com \
--to=xiyou.wangcong@gmail.com \
--cc=dick@streefland.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®