lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070913201727.GW475@flower.upol.cz>
Date:	Thu, 13 Sep 2007 22:17:27 +0200
From:	Oleg Verych <olecom@...wer.upol.cz>
To:	Sam Ravnborg <sam@...nborg.org>
Cc:	Chris Wedgwood <cw@...f.org>, LKML <linux-kernel@...r.kernel.org>,
	davej@...hat.com, Eric Sandeen <sandeen@...deen.net>
Subject: Re: [RFC PATCH] Add a 'minimal tree install' target

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.
____
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ