From: Oleg Verych <olecom@flower.upol.cz>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Chris Wedgwood <cw@f00f.org>, LKML <linux-kernel@vger.kernel.org>,
davej@redhat.com, Eric Sandeen <sandeen@sandeen.net>
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target
Date: Thu, 13 Sep 2007 22:17:27 +0200 [thread overview]
Message-ID: <20070913201727.GW475@flower.upol.cz> (raw)
In-Reply-To: <20070913191938.GD27146@uranus.ravnborg.org>
Hallo.
On Thu, Sep 13, 2007 at 09:19:38PM +0200, Sam Ravnborg wrote:
[]
> >
> > sed -n "s/^ALTARCH[[:space:]]:=[[:space:]]\(.*$\)\+/\1/p"
> >
> > (i'm sure there is a better way though)
>
> Oleg (added to mail) - you are quite confident in sed et al.
> Let us know if there is a simpler way.
>
> (We want to pick i386 from include/asm-x86_64/Kbuild
> and similar for the architectures that uses ARCHDEF).
That particular one-line `ALTARCH := i386' of course can be matched
simpler, because there's only *one* (as written above) whitespace and no
make's assignment variations, like (?=,=). I wonder, if there can be more
options, than i386 and more occurrences of `ALTARCH' actually :) Also,
make can have lead whitespace on line start, as well as near assignment
sign, if that matters.
So, to match *one* line with *one* `ALTARCH' followed by `i386'
sed -n '/ALTARCH/{/i386/{p ; q}}'
is fine by me. If there are dis-assignments, so to speak, or comments
with i386 this will not work obviously. But it's fast and must work
with variety of make syntax. Check is "for non empty output".
Also, please take a look on man isspace(). It matches much more
characters, than necessary for ordinary syntax whitespace. Using
[:blank:] (i.e. tab and space, with no options) is OK. Last thing: i'm not
sure, what that `+' is. I stick to BRE in sed, as it should be, so just
don't know what it does.
Hope that helps.
____
next prev parent reply other threads:[~2007-09-13 20:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-12 23:25 [RFC PATCH] Add a 'minimal tree install' target Chris Wedgwood
2007-09-13 18:34 ` Sam Ravnborg
2007-09-13 18:37 ` Robert P. J. Day
2007-09-13 19:26 ` Sam Ravnborg
2007-09-14 9:59 ` Tilman Schmidt
2007-09-13 18:57 ` Chris Wedgwood
2007-09-13 19:19 ` Sam Ravnborg
2007-09-13 20:17 ` Oleg Verych [this message]
2007-09-13 20:05 ` Chris Wedgwood
2007-09-14 10:04 ` Oleg Verych
2007-09-13 23:27 ` Dave Jones
2007-09-14 16:44 ` Goswin von Brederlow
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=20070913201727.GW475@flower.upol.cz \
--to=olecom@flower.upol.cz \
--cc=cw@f00f.org \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=sandeen@sandeen.net \
/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